1--TEST-- 2SPL: ArrayObject::__construct with bad iterator. 3--FILE-- 4<?php 5echo "Bad iterator type:\n"; 6$a = new stdClass; 7$a->p = 1; 8try { 9 var_dump(new ArrayObject($a, 0, "Exception")); 10} catch (TypeError $e) { 11 echo $e->getMessage() . "(" . $e->getLine() . ")\n"; 12} 13 14echo "Non-existent class:\n"; 15try { 16 var_dump(new ArrayObject(new stdClass, 0, "nonExistentClassName")); 17} catch (TypeError $e) { 18 echo $e->getMessage() . "(" . $e->getLine() . ")\n"; 19} 20?> 21--EXPECT-- 22Bad iterator type: 23ArrayObject::__construct() expects parameter 3 to be a class name derived from ArrayIterator, 'Exception' given(6) 24Non-existent class: 25ArrayObject::__construct() expects parameter 3 to be a class name derived from ArrayIterator, 'nonExistentClassName' given(13) 26