mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
added backward incompatible changes. Missing some examples for clarification now
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150186 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
aca706a4e2
commit
7c342c241d
1 changed files with 49 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<appendix id="migration5">
|
||||
<title>Migrating from PHP 4 to PHP 5</title>
|
||||
|
||||
|
@ -20,9 +20,54 @@
|
|||
<section id="migration5.incompatible">
|
||||
<title>Backward Incompatible Changes</title>
|
||||
<para>
|
||||
Although most existing PHP 4 code should work without changes, you shoud
|
||||
pay attention to this backward imcompatible changes:
|
||||
</para>
|
||||
Although most existing PHP 4 code should work without changes, you should
|
||||
pay attention to this backward imcompatible changes:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><simpara>
|
||||
<function>strrpos</function> and <function>strripos</function> now use
|
||||
the entire string as a needle.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
Ilegal use of string offsets causes <constant>E_ERROR</constant> instead
|
||||
of <constant>E_WARNING</constant>.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
<function>array_merge</function> was changed to accept only arrays. If a
|
||||
non-array variable is passed, a <constant>E_WARNING</constant> will be
|
||||
thrown for every such parameter. Be careful because your code may start
|
||||
emitting <constant>E_WARNING</constant> out of the blue.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
PATH_TRANSLATED server variable is no longer set implicitly under
|
||||
Apache2 SAPI in contrast to the situation in PHP 4, where it is set to
|
||||
the same value as the SCRIPT_FILENAME server variable when it is not
|
||||
populated by Apache. This change was made to comply with the <ulink
|
||||
url="&url.cgispecs;">CGI specification</ulink>. Please refer to <ulink
|
||||
url="&url.php.bugs;23610">bug #23610</ulink> for further information.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
The <constant>T_ML_CONSTANT</constant> constant is no longer defined by
|
||||
the <link linkend="ref.tokenizer">Tokenizer</link> extension. If
|
||||
error_reporting is set to <constant>E_ALL</constant>, PHP will generate a
|
||||
notice. Instead of <constant>T_ML_CONSTANT</constant> for /* */ the
|
||||
<constant>T_COMMENT</constant> constant is used, thus both // and /* */
|
||||
are resolved as the <constant>T_COMMENT</constant> constant. However the
|
||||
PHPDoc style comments /** */ ,which starting PHP5 are parsed by PHP, are
|
||||
recongnized as <constant>T_DOC_COMMENT</constant>.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
$_SERVER should be populated with argc and argv if variables_order
|
||||
includes "S". If you have specifically configured your system to not
|
||||
create $_SERVER, then of course it shouldn't be there. The change was to
|
||||
always make argc and argv available in the CLI version regardless of the
|
||||
variables_order setting. As in, the CLI version will now always populate
|
||||
the global $argc and $argv variables.
|
||||
</simpara></listitem>
|
||||
<listitem><simpara>
|
||||
Classes must be declared before used.
|
||||
</simpara></listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
|
|
Loading…
Reference in a new issue