Re: [PHP4BETA] incompatibe php3 <-> 4 + suggestion for php3

From: Date: Wed, 30 Jun 1999 18:10:19 +0000
Subject: Re: [PHP4BETA] incompatibe php3 <-> 4 + suggestion for php3
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-1756@lists.php.net to get a copy of this message
At 16:22 30/06/99 , Thies C. Arntzen wrote:
hi script (taken from twig): <? error_reporting(-1); $login[username] = "tubu"; $session[thisGroup] = "tubu"; function groupSelect($username = "$login[username]", $gid = "$session[thisGroup]") { } ?> wroks in 3.0 but barfs with 4.0 i never knew you could do stuff like this!
Yeah, that's one incompatibility we're aware of. We truly didn't mean for this to work in PHP 3.0 either (and there's a VERY good chance it fucks up memory allocation somewhere; we clearly did NOT want variable reference in there, but due to the grammar, variable references slipped in via quoted strings). At this time, we have no intention of supporting this notation in PHP 4.0.
one other thing that comes to my mind is that many people seem to use: $data[tubu] = 1; instead of: $data["tubu"] = 1; so they can embed this in strings like: echo "name is $data[tubu]"; without escaping! now - if you use "error_reporting(-1);" (which i prefer to do) you get: PHP 3 Warning: 'tubu' is not a valid constant - assumed to be "tubu" in hmm.php on line 3. could we remove this warning (in PHP3!) as it seems to be standart coding-practise to ommit the quotes around array indices?
No, it may be a standard coding practice, but it's definitely not an encouraged one. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#1756) next »