mirror of
https://github.com/php/php-src.git
synced 2024-12-13 20:05:26 +08:00
a197c0b751
# These tests were failing on different configurations, so adding them # all to get more chances of seeing one failing in case of problem.
68 lines
858 B
PHP
68 lines
858 B
PHP
--TEST--
|
|
Bug #48409 (crash when exception is thrown while passing function arguments)
|
|
--FILE--
|
|
<?php
|
|
|
|
class ABCException extends Exception {}
|
|
|
|
class BBB
|
|
{
|
|
public function xyz($d, $x)
|
|
{
|
|
if ($x == 34) {
|
|
throw new ABCException;
|
|
}
|
|
return array('foo' => 'xyz');
|
|
}
|
|
}
|
|
|
|
class CCC
|
|
{
|
|
public function process($p)
|
|
{
|
|
return $p;
|
|
}
|
|
}
|
|
|
|
class AAA
|
|
{
|
|
public function func()
|
|
{
|
|
$b = new BBB;
|
|
$c = new CCC;
|
|
$i = 34;
|
|
$item = array('foo' => 'bar');
|
|
try {
|
|
$c->process($b->xyz($item['foo'], $i));
|
|
}
|
|
catch(ABCException $e) {
|
|
$b->xyz($item['foo'], $i);
|
|
}
|
|
} // end func();
|
|
}
|
|
|
|
class Runner
|
|
{
|
|
public function run($x)
|
|
{
|
|
try {
|
|
$x->func();
|
|
}
|
|
catch(ABCException $e) {
|
|
throw new Exception;
|
|
}
|
|
}
|
|
}
|
|
|
|
try {
|
|
$runner = new Runner;
|
|
$runner->run(new AAA);
|
|
}
|
|
catch(Exception $e) {
|
|
die('Exception thrown');
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Exception thrown
|