[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays

2001-09-05 Thread joey

ID: 13138
Updated by: joey
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Closed
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 4.0.4pl1
New Comment:

Great. If you still have problems, please reopen.

Previous Comments:


[2001-09-04 16:51:52] [EMAIL PROTECTED]

Please try a more recent version of PHP. 4.0.7RC1 gives
me:
array(1) {
  [1]=
  bool(true)
}
array(1) {
  [1]=
  bool(true)
}



[2001-09-04 13:23:25] [EMAIL PROTECTED]

I think the following piece of code behaves sort of weird:

?
define ('A', 1);

function test()
{
$a = array(1 = true);
static $stat_a = array(A = true);

var_dump($a);
var_dump($stat_a);
}
test();
?

result is:
array(1) {
  [1]=
  bool(true)
}
array(1) {
  [A]=
  bool(true)
}

I'm not sure whether static variables are supposed to evaluate expressions but even if 
they were not, the engine should at least issue a warning.






Edit this bug report at http://bugs.php.net/?id=13138edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays

2001-09-04 Thread joey

ID: 13138
Updated by: joey
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 4.0.4pl1
New Comment:

Please try a more recent version of PHP. 4.0.7RC1 gives
me:
array(1) {
  [1]=
  bool(true)
}
array(1) {
  [1]=
  bool(true)
}

Previous Comments:


[2001-09-04 13:23:25] [EMAIL PROTECTED]

I think the following piece of code behaves sort of weird:

?
define ('A', 1);

function test()
{
$a = array(1 = true);
static $stat_a = array(A = true);

var_dump($a);
var_dump($stat_a);
}
test();
?

result is:
array(1) {
  [1]=
  bool(true)
}
array(1) {
  [A]=
  bool(true)
}

I'm not sure whether static variables are supposed to evaluate expressions but even if 
they were not, the engine should at least issue a warning.






Edit this bug report at http://bugs.php.net/?id=13138edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]