git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@70872 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sebastian Nohn 2002-02-24 17:03:54 +00:00
parent c7b64a1f72
commit 24822067dd

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.18 $ -->
<!-- $Revision: 1.19 $ -->
<appendix id="migration4">
<title>Migrating from PHP 3 to PHP 4</title>
@ -423,6 +423,33 @@ php_admin_flag [PHP directive name] [On|Off]
</para>
</section>
<section id='migration4.variables'>
<title>Handling of global variables</title>
<para>
While handling of global variables had the focus on to be easy in
PHP3 and early versions of PHP4, the focus has changed to be more
secure. While in PHP3 following example worked fine, in PHP4 it
has to be unset($GLOBALS["id"]);. This is only one issue of global
variable handling. You should always have used $GLOBALS, with
newer versions of PHP4 you are forced to do so in most cases.
</para>
<example>
<programlisting role="php">
<![CDATA[
<?php
$id=1;
function test()
{
global $id;
unset($id);
}
test();
echo($id);
]]>
</programlisting>
</example>
</section>
</appendix>