mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Add new test
This commit is contained in:
parent
e20f534ee5
commit
c49b657084
1 changed files with 71 additions and 0 deletions
71
Zend/tests/bug26698.phpt
Executable file
71
Zend/tests/bug26698.phpt
Executable file
|
@ -0,0 +1,71 @@
|
|||
--TEST--
|
||||
Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Object
|
||||
{
|
||||
function getNone()
|
||||
{
|
||||
throw new Exception('NONE');
|
||||
}
|
||||
}
|
||||
|
||||
class Proxy
|
||||
{
|
||||
function three($a, $b, $c)
|
||||
{
|
||||
}
|
||||
|
||||
function callOne()
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new Object();
|
||||
$this->three($res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo 'Caught: '.$e->getMessage()."\n";
|
||||
}
|
||||
}
|
||||
|
||||
function callTwo()
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new Object();
|
||||
$this->three(1, $res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo 'Caught: '.$e->getMessage()."\n";
|
||||
}
|
||||
}
|
||||
|
||||
function callThree()
|
||||
{
|
||||
try
|
||||
{
|
||||
$res = new Object();
|
||||
$this->three(1, 2, $res->getNone());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo 'Caught: '.$e->getMessage()."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Proxy();
|
||||
|
||||
$p->callOne();
|
||||
$p->callTwo();
|
||||
$p->callThree();
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught: NONE
|
||||
Caught: NONE
|
||||
Caught: NONE
|
||||
===DONE===
|
Loading…
Add table
Add a link
Reference in a new issue