com php-src: Added new test: Zend/tests/foreach_008.p hpt

From: Date: Thu, 29 Jan 2015 18:43:28 +0000
Subject: com php-src: Added new test: Zend/tests/foreach_008.p hpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-97602@lists.php.net to get a copy of this message
Commit: 721fc9e80d2ee8f2cd79c8c3cdceffae2c72de92 Author: Dmitry Stogov <dmitry@zend.com> Thu, 29 Jan 2015 21:43:28 +0300 Parents: 15a23b1218b3e38630d677751a975907daa2cd54 Branches: dstogov-foreach Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=721fc9e80d2ee8f2cd79c8c3cdceffae2c72de92 Log: Added new test Changed paths: A Zend/tests/foreach_008.phpt Diff: diff --git a/Zend/tests/foreach_008.phpt b/Zend/tests/foreach_008.phpt new file mode 100644 index 0000000..c68bcd8 --- /dev/null +++ b/Zend/tests/foreach_008.phpt @@ -0,0 +1,21 @@ +--TEST-- +Nested foreach by reference and array modification +--FILE-- +<?php +$a = [0, 1, 2, 3]; +foreach ($a as &$x) { + foreach ($a as &$y) { + echo "$x - $y\n"; + if ($x == 0 && $y == 1) { + unset($a[2]); + unset($a[1]); + } + } +} +?> +--EXPECT-- +0 - 0 +0 - 1 +0 - 3 +3 - 0 +3 - 3

« previous php.cvs (#97602) next »