com php-src: New test: Zend/tests/foreach_007.phpt
[email protected] (Rasmus Lerdorf)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 10a3260b1f16b6075fd8140f673dfef4d5efea91 Author: Dmitry Stogov <[email protected]> Thu, 29 Jan 2015 21:04:44 +0300 Parents: 2705d17c93020c930a3a50f86eff93a4e75550ca Branches: dstogov-foreach Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=10a3260b1f16b6075fd8140f673dfef4d5efea91 Log: New test Changed paths: A Zend/tests/foreach_007.phpt Diff: diff --git a/Zend/tests/foreach_007.phpt b/Zend/tests/foreach_007.phpt new file mode 100644 index 0000000..b99bc73 --- /dev/null +++ b/Zend/tests/foreach_007.phpt @@ -0,0 +1,13 @@ +--TEST-- +Foreach by reference and inserting new element when we are already at the end +--FILE-- +<?php +$a = [1]; +foreach($a as &$v) { + echo "$v\n"; + $a[1]=2; +} +?> +--EXPECT-- +1 +2