HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux dev1 5.15.83-1-pve #1 SMP PVE 5.15.83-1 (2022-12-15T00:00Z) x86_64
User: safarimaris (1000)
PHP: 7.2.34-54+ubuntu22.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //opt/php-5.6.40/Zend/tests/bug48409.phpt
--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