Case sensitivity of include_once and require_once (thanks to Michele Locati)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@163854 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2004-07-21 09:05:12 +00:00
parent 2e3cff0476
commit 8b707a0204
2 changed files with 18 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.24 $ -->
<!-- $Revision: 1.25 $ -->
<appendix id="migration5">
<title>Migrating from PHP 4 to PHP 5</title>
@ -102,11 +102,18 @@
</listitem>
<listitem>
<simpara>
<function>ip2long</function> now returns FALSE when an invalid IP
<function>ip2long</function> now returns &false; when an invalid IP
address is passed as argument to the function, and no longer
<literal>-1</literal>.
</simpara>
</listitem>
<listitem>
<simpara>
<function>include_once</function> and <function>require_once</function>
first normalize the path of included file on Windows so that including
A.php and a.php include the file just once.
</simpara>
</listitem>
</itemizedlist>
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.94 $ -->
<!-- $Revision: 1.95 $ -->
<chapter id="language.control-structures">
<title>Control Structures</title>
@ -1526,11 +1526,14 @@ echo $bar; // prints 1
<![CDATA[
<?php
require_once("a.php"); // this will include a.php
require_once("A.php"); // this will include a.php again on Windows!
require_once("A.php"); // this will include a.php again on Windows! (PHP 4 only)
?>
]]>
</programlisting>
</example>
This behaviour changed in PHP 5 - the path is normalized first so that
<filename>C:\PROGRA~1\A.php</filename> is realized the same as
<filename>C:\Program Files\a.php</filename> and the file is required just once.
</para>
</note>
</para>
@ -1586,11 +1589,14 @@ require_once("A.php"); // this will include a.php again on Windows!
<![CDATA[
<?php
include_once("a.php"); // this will include a.php
include_once("A.php"); // this will include a.php again on Windows!
include_once("A.php"); // this will include a.php again on Windows! (PHP 4 only)
?>
]]>
</programlisting>
</example>
This behaviour changed in PHP 5 - the path is normalized first so that
<filename>C:\PROGRA~1\A.php</filename> is realized the same as
<filename>C:\Program Files\a.php</filename> and the file is included just once.
</para>
</note>
</para>