php-src/ext/spl/tests/array_021.phpt
2012-10-10 10:27:49 +08:00

32 lines
373 B
PHP

--TEST--
SPL: ArrayObject::seek() and exceptions
--FILE--
<?php
class foo extends ArrayObject
{
public function seek($key)
{
echo __METHOD__ . "($key)\n";
throw new Exception("hi");
}
}
$test = new foo(array(1,2,3));
try
{
$test->seek('bar');
}
catch (Exception $e)
{
echo "got exception\n";
}
?>
===DONE===
--EXPECT--
foo::seek(bar)
got exception
===DONE===