Annotation of embedaddon/php/ext/standard/tests/array/bug22463.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #22463 (array_reduce() segfaults)
! 3: --FILE--
! 4: <?php
! 5:
! 6: function a($ary) {
! 7: return (is_array($ary) ? array_reduce($ary, 'cb', 0) : 1);
! 8: }
! 9:
! 10: function cb($v, $elem) {
! 11: return $v + a($elem);
! 12: }
! 13:
! 14: $ary = array(
! 15: array(
! 16: array(
! 17: array(
! 18: array(
! 19: array(0, 1, 2, 3, 4)
! 20: )
! 21: )
! 22: )
! 23: )
! 24: );
! 25:
! 26: var_dump(a($ary));
! 27: ?>
! 28: --EXPECT--
! 29: int(5)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>