derek Wed Jan 19 01:51:01 2005 EDT
Modified files: /phpdoc/en/language variables.xml Log: Adding a note about HTTP_POST_VARS being deprecated to variables.scope, and making quotes consistent http://cvs.php.net/diff.php/phpdoc/en/language/variables.xml?r1=1.84&r2=1.85&ty=u Index: phpdoc/en/language/variables.xml diff -u phpdoc/en/language/variables.xml:1.84 phpdoc/en/language/variables.xml:1.85 --- phpdoc/en/language/variables.xml:1.84 Fri Jan 7 03:22:16 2005 +++ phpdoc/en/language/variables.xml Wed Jan 19 01:51:00 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.84 $ --> +<!-- $Revision: 1.85 $ --> <chapter id="language.variables"> <title>Variables</title> @@ -36,8 +36,8 @@ <programlisting role="php"> <![CDATA[ <?php -$var = "Bob"; -$Var = "Joe"; +$var = 'Bob'; +$Var = 'Joe'; echo "$var, $Var"; // outputs "Bob, Joe" $4site = 'not yet'; // invalid; starts with a number @@ -335,7 +335,7 @@ <![CDATA[ <?php $a = 1; -include "b.inc"; +include 'b.inc'; ?> ]]> </programlisting> @@ -431,7 +431,7 @@ function Sum() { - $GLOBALS["b"] = $GLOBALS["a"] + $GLOBALS["b"]; + $GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b']; } Sum(); @@ -467,7 +467,8 @@ // Superglobals are available in any scope and do // not require 'global'. Superglobals are available - // as of PHP 4.1.0 + // as of PHP 4.1.0, and HTTP_POST_VARS is now + // deemed deprecated. echo $_POST['name']; } ?> @@ -652,7 +653,7 @@ function &get_instance_ref() { static $obj; - echo "Static object: "; + echo 'Static object: '; var_dump($obj); if (!isset($obj)) { // Assign a reference to the static variable @@ -665,7 +666,7 @@ function &get_instance_noref() { static $obj; - echo "Static object: "; + echo 'Static object: '; var_dump($obj); if (!isset($obj)) { // Assign the object to the static variable @@ -721,7 +722,7 @@ <programlisting role="php"> <![CDATA[ <?php -$a = "hello"; +$a = 'hello'; ?> ]]> </programlisting> @@ -738,7 +739,7 @@ <programlisting role="php"> <![CDATA[ <?php -$$a = "world"; +$$a = 'world'; ?> ]]> </programlisting> @@ -1004,8 +1005,8 @@ <programlisting role="php"> <![CDATA[ <?php - setcookie("MyCookie[foo]", "Testing 1", time()+3600); - setcookie("MyCookie[bar]", "Testing 2", time()+3600); + setcookie("MyCookie[foo]", 'Testing 1', time()+3600); + setcookie("MyCookie[bar]", 'Testing 2', time()+3600); ?> ]]> </programlisting> @@ -1035,7 +1036,7 @@ } else { $count = 1; } -setcookie("count", $count, time()+3600); +setcookie('count', $count, time()+3600); setcookie("Cart[$count]", $item, time()+3600); ?> ]]>