php-src/Zend/tests/bug26698.phpt

72 lines
1.2 KiB
Plaintext
Raw Normal View History

2003-12-27 20:45:36 +00:00
--TEST--
2018-08-10 02:19:55 +00:00
Bug #26698 (Thrown exceptions while evaluating argument to pass as parameter crash PHP)
2003-12-27 20:45:36 +00:00
--FILE--
<?php
2004-02-10 22:13:07 +00:00
ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
class ObjectOne
2003-12-27 20:45:36 +00:00
{
2020-02-03 21:52:20 +00:00
function getNone()
{
throw new Exception('NONE');
}
2003-12-27 20:45:36 +00:00
}
class Proxy
{
2020-02-03 21:52:20 +00:00
function three($a, $b, $c)
{
}
2003-12-27 20:45:36 +00:00
2020-02-03 21:52:20 +00:00
function callOne()
{
try
{
$res = new ObjectOne();
$this->three($res->getNone());
}
catch(Exception $e)
{
echo 'Caught: '.$e->getMessage()."\n";
}
}
2003-12-27 20:45:36 +00:00
2020-02-03 21:52:20 +00:00
function callTwo()
{
try
{
$res = new ObjectOne();
$this->three(1, $res->getNone());
}
catch(Exception $e)
{
echo 'Caught: '.$e->getMessage()."\n";
}
}
2003-12-27 20:45:36 +00:00
2020-02-03 21:52:20 +00:00
function callThree()
{
try
{
$res = new ObjectOne();
$this->three(1, 2, $res->getNone());
}
catch(Exception $e)
{
echo 'Caught: '.$e->getMessage()."\n";
}
}
2003-12-27 20:45:36 +00:00
}
$p = new Proxy();
$p->callOne();
$p->callTwo();
$p->callThree();
?>
--EXPECT--
Caught: NONE
Caught: NONE
Caught: NONE