PHP 4.0 Bug #5275: behaviour inconsistency of the `&' operator
| From: | teo at digiro dot net | Date: | Thu, 29 Jun 2000 22:55:35 +0000 |
| Subject: | PHP 4.0 Bug #5275: behaviour inconsistency of the `&' operator | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22688@lists.php.net to get a copy of this message | ||
From: teo@digiro.net
Operating system: RH6.2
PHP version: 4.0 Latest CVS (29/06/2000)
PHP Bug Type: Scripting Engine problem
Bug description: behaviour inconsistency of the `&' operator
example:
<?
class Session {
function Session()
{
session_start();
global $HTTP_SESSION_VARS, $GLOB;
($HTTP_SESSION_VARS != null) && ($this->_v1 = &$HTTP_SESSION_VARS);
$this->_v2 = &$HTTP_SESSION_VARS;
($GLOB != null) && ($this->_v3 = &$GLOB);
$this->_v4 = &$GLOB;
}
}
$GLOB = 'asta e';
$s1 = new Session();
printf ("1) cmp v1 v2 = %d <br>\n", $s1->_v1 === $s1->_v2);
printf ("2) cmp v2 SESS = %d<br>\n", $s1->_v2 === $HTTP_SESSION_VARS);
printf ("3) cmp v3 v4 = %d <br>\n", $s1->_v3 === $s1->_v4);
printf ("4) cmp v4 GLOB = %d\n", $s1->_v4 === $GLOB);
The expected output would have been:
1 1 1 1
the actual result is:
0 1 1 1
Configuration: PHP4 as Apache module, register_globals off , track_vars on
The same bevaviour is shown when I try any HTTP_*_VARS that are set upon request