php-src/Zend/tests/anonymous_func_002.phpt

17 lines
303 B
Plaintext
Raw Normal View History

2008-05-11 11:15:13 +08:00
--TEST--
Testing anonymous function return as array key and accessing $GLOBALS
--FILE--
<?php
$test = create_function('$v', 'return $v;');
$arr = array(create_function('', 'return $GLOBALS["arr"];'), 2);
var_dump($arr[$test(1)]);
var_dump($arr[$test(0)]() == $arr);
?>
--EXPECT--
int(2)
bool(true)