Date: 09/04/01
- Next message: Jason Greene: "[PHP-DEV] Re: ([PATCH] SOCKETS Solaris issues with gcc) & socket_read issue with new api"
- Previous message: Sterling Hughes: "Re: [PHP-DEV] Rand"
- Next in thread: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: jack <email protected>
Operating system: linux
PHP version: 4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description: constants behave weird in static hash arrays
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 bug report at: http://bugs.php.net/?id=13138&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jason Greene: "[PHP-DEV] Re: ([PATCH] SOCKETS Solaris issues with gcc) & socket_read issue with new api"
- Previous message: Sterling Hughes: "Re: [PHP-DEV] Rand"
- Next in thread: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13138 Updated: constants behave weird in static hash arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

