PHP 4.0 Bug #9863 Updated: "global $var" incompatibility between PHP 3 & 4

From: Date: Tue, 20 Mar 2001 11:40:23 +0000
Subject: PHP 4.0 Bug #9863 Updated: "global $var" incompatibility between PHP 3 & 4
Groups: php.dev 
Request: Send a blank email to php-dev+get-49479@lists.php.net to get a copy of this message
ID: 9863 Updated by: hholzgra Reported By: hartmut@six.de Old-Status: Open Status: Bogus Bug Type: Scripting Engine problem Assigned To: Comments: can't reproduce anymore, please ignore Previous Comments: --------------------------------------------------------------------------- [2001-03-20 06:27:17] hartmut@six.de consider the following code snippet: <? function foo() { global $bar; $bar="hello"; } foo(); echo $bar; ?> in PHP 3 calling foo() will create a global variable $bar if it doesn't exist in PHP 4 there will be no $bar after calling foo i think PHP 4 should behave like PHP 3 here not only due to compatibility reasons but also due to the "least supprise" rule --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9863&edit=2

« previous php.dev (#49479) next »