diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:28 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:28 -0400 |
| commit | ba50031707469046407a35b77a3cd81351e951b3 (patch) | |
| tree | 5c03e723bdbfabae09d41a3ab1253dff41eeed4a /ext/spl/tests/array_019.phpt | |
| parent | 0a36161e13484a99ccf69bb38f206462d27cc6d6 (diff) | |
| download | php-upstream/5.1.5.tar.gz | |
Imported Upstream version 5.1.5upstream/5.1.5
Diffstat (limited to 'ext/spl/tests/array_019.phpt')
| -rwxr-xr-x | ext/spl/tests/array_019.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/spl/tests/array_019.phpt b/ext/spl/tests/array_019.phpt new file mode 100755 index 000000000..1416d8407 --- /dev/null +++ b/ext/spl/tests/array_019.phpt @@ -0,0 +1,32 @@ +--TEST-- +SPL: ArrayIterator and foreach by reference +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php + +$ar = new ArrayObject(array(1)); foreach($ar as &$v) var_dump($v); +$ar = new ArrayIterator(array(2)); foreach($ar as &$v) var_dump($v); +$ar = new RecursiveArrayIterator(array(3)); foreach($ar as &$v) var_dump($v); + +class ArrayIteratorEx extends ArrayIterator +{ + function current() + { + return ArrayIterator::current(); + } +} + +$ar = new ArrayIteratorEx(array(4)); foreach($ar as $v) var_dump($v); +$ar = new ArrayIteratorEx(array(5)); foreach($ar as &$v) var_dump($v); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +int(1) +int(2) +int(3) +int(4) +int(5) +===DONE=== |
