Annotation of embedaddon/php/Zend/tests/anonymous_func_002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Testing anonymous function return as array key and accessing $GLOBALS
! 3: --FILE--
! 4: <?php
! 5:
! 6: $test = create_function('$v', 'return $v;');
! 7:
! 8: $arr = array(create_function('', 'return $GLOBALS["arr"];'), 2);
! 9:
! 10: var_dump($arr[$test(1)]);
! 11: var_dump($arr[$test(0)]() == $arr);
! 12:
! 13: ?>
! 14: --EXPECT--
! 15: int(2)
! 16: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>