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

32 lines
406 B
Plaintext
Raw Normal View History

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