Commit: 99076bc24fae6b159c783e4772b0eaf046b5dc2e Author: Xinchen Hui <larue...@php.net> Sun, 6 May 2012 20:31:40 +0800 Parents: 7ccd5943924fd4ad9adcad1fbc547adc79114bff Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=99076bc24fae6b159c783e4772b0eaf046b5dc2e Log: Change the test folder Changed paths: A ext/standard/tests/array/bug61730.phpt D ext/standard/tests/bug61730.phpt Diff: diff --git a/ext/standard/tests/array/bug61730.phpt b/ext/standard/tests/array/bug61730.phpt new file mode 100644 index 0000000..0fe9f22 --- /dev/null +++ b/ext/standard/tests/array/bug61730.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #61730 (Segfault from array_walk modifying an array passed by reference) +--FILE-- +<?php +$myArray = array_fill(0, 10, 1); + +array_walk( + $myArray, + function($value, $key) use ($myArray) + { + reset($myArray); + } +); + +array_walk( + $myArray, + function($value, $key) use (&$myArray) + { + var_dump($key); + unset($myArray[$key]); + unset($myArray[$key+1]); + unset($myArray[$key+2]); + } +); + + + +print_r($myArray); +--EXPECT-- +int(0) +int(4) +int(8) +Array +( + [3] => 1 + [7] => 1 +) diff --git a/ext/standard/tests/bug61730.phpt b/ext/standard/tests/bug61730.phpt deleted file mode 100644 index 0fe9f22..0000000 --- a/ext/standard/tests/bug61730.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #61730 (Segfault from array_walk modifying an array passed by reference) ---FILE-- -<?php -$myArray = array_fill(0, 10, 1); - -array_walk( - $myArray, - function($value, $key) use ($myArray) - { - reset($myArray); - } -); - -array_walk( - $myArray, - function($value, $key) use (&$myArray) - { - var_dump($key); - unset($myArray[$key]); - unset($myArray[$key+1]); - unset($myArray[$key+2]); - } -); - - - -print_r($myArray); ---EXPECT-- -int(0) -int(4) -int(8) -Array -( - [3] => 1 - [7] => 1 -) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php