php-src/ext/spl/tests/bug36825.phpt

32 lines
407 B
Plaintext
Raw Normal View History

2006-03-23 07:10:59 +08:00
--TEST--
Bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault)
2006-03-23 07:10:59 +08:00
--FILE--
<?php
class foo extends ArrayObject
{
public function offsetGet($key)
{
echo __METHOD__ . "($key)\n";
2006-03-23 07:10:59 +08:00
throw new Exception("hi");
}
}
$test = new foo();
try
{
2006-03-23 07:10:59 +08:00
var_dump($test['bar']);
}
catch (Exception $e)
{
2006-03-23 07:10:59 +08:00
echo "got exception\n";
}
?>
===DONE===
2006-03-23 07:10:59 +08:00
--EXPECT--
foo::offsetGet(bar)
2006-03-23 07:10:59 +08:00
got exception
===DONE===