php-src/Zend/tests/anonymous_func_002.phpt

20 lines
445 B
Plaintext
Raw Normal View History

2008-05-11 03:15:13 +00: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);
?>
2017-01-30 21:09:32 +00:00
--EXPECTF--
Deprecated: Function create_function() is deprecated in %s on line %d
Deprecated: Function create_function() is deprecated in %s on line %d
2008-05-11 03:15:13 +00:00
int(2)
bool(true)