Annotation of embedaddon/php/Zend/tests/bug40509.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #40509 (key() function changed behaviour if global array is used within function)
! 3: --FILE--
! 4: <?php
! 5: function foo()
! 6: {
! 7: global $arr;
! 8:
! 9: $c = $arr["v"];
! 10: foreach ($c as $v) {}
! 11: }
! 12:
! 13: $arr["v"] = array("a");
! 14:
! 15: var_dump(key($arr["v"]));
! 16: foo();
! 17: var_dump(key($arr["v"]));
! 18: foreach ($arr["v"] as $k => $v) {
! 19: var_dump($k);
! 20: }
! 21: var_dump(key($arr["v"]));
! 22: --EXPECT--
! 23: int(0)
! 24: int(0)
! 25: int(0)
! 26: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>