|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-09-04 13:23 UTC] jack at mobil dot cz
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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
Please try a more recent version of PHP. 4.0.7RC1 gives me: array(1) { [1]=> bool(true) } array(1) { [1]=> bool(true) }