php-src/ext/spl/tests/iterator_036.phpt
Marcus Boerger 7d79686f45 - MFH Fixed CachingIterator issues with string conversion/__toString()
Partly by adding new mode TOSTRING_USE_INNER
2006-05-18 21:42:58 +00:00

25 lines
431 B
PHP
Executable File

--TEST--
SPL: CachingIterator and __toString and flags = 0
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
function test($it)
{
foreach($it as $v)
{
var_dump((string)$it);
}
}
$ar = new ArrayIterator(array(1, 2, 3));
test(new CachingIterator($ar, 0));
?>
===DONE===
--EXPECTF--
Fatal error: Method CachingIterator::__toString() must not throw an exception in %siterator_036.php on line %d