- <example> needs a title in it befor <programlisting> to work => build

braking error corrected
 - PHP3 and PHP4 are PHP 3 and PHP 4
 - linking in global references
 - adding comment to example


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@70901 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2002-02-25 09:06:40 +00:00
parent 24822067dd
commit 77fc478d85

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.19 $ -->
<!-- $Revision: 1.20 $ -->
<appendix id="migration4">
<title>Migrating from PHP 3 to PHP 4</title>
@ -427,24 +427,27 @@ php_admin_flag [PHP directive name] [On|Off]
<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
PHP 3 and early versions of PHP 4, the focus has changed to be more
secure. While in PHP 3 the following example worked fine, in PHP 4 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.
newer versions of PHP 4 you are forced to do so in most cases.
Read more on this subject in the <link linkend="references.global">
<literal>global</literal> references section</link>.
</para>
<example>
<title>Migration of global variables</title>
<programlisting role="php">
<![CDATA[
<?php
$id=1;
$id = 1;
function test()
{
global $id;
unset($id);
global $id;
unset($id);
}
test();
echo($id);
echo($id); // This will print out 1 in PHP 4
]]>
</programlisting>
</example>