2008-05-11 11:15:13 +08:00
|
|
|
--TEST--
|
|
|
|
Testing anonymous function return as array key and accessing $GLOBALS
|
|
|
|
--FILE--
|
2018-09-17 01:16:42 +08:00
|
|
|
<?php
|
2008-05-11 11:15:13 +08:00
|
|
|
|
|
|
|
$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-31 05:09:32 +08: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 11:15:13 +08:00
|
|
|
int(2)
|
|
|
|
bool(true)
|