File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug26698.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP)
    3: --FILE--
    4: <?php
    5: 
    6: ini_set("report_memleaks", 0);  // the exception thrown in this test results in a memory leak, which is fine
    7: 
    8: class Object
    9: {
   10: 	function getNone()
   11: 	{
   12: 		throw new Exception('NONE');
   13: 	}
   14: }
   15: 
   16: class Proxy
   17: {
   18: 	function three($a, $b, $c)
   19: 	{
   20: 	}
   21: 
   22: 	function callOne()
   23: 	{
   24: 		try
   25: 		{
   26: 			$res = new Object();
   27: 			$this->three($res->getNone());
   28: 		}
   29: 		catch(Exception $e)
   30: 		{
   31: 			echo 'Caught: '.$e->getMessage()."\n";
   32: 		}
   33: 	}
   34: 
   35: 	function callTwo()
   36: 	{
   37: 		try
   38: 		{
   39: 			$res = new Object();
   40: 			$this->three(1, $res->getNone());
   41: 		}
   42: 		catch(Exception $e)
   43: 		{
   44: 			echo 'Caught: '.$e->getMessage()."\n";
   45: 		}
   46: 	}
   47: 
   48: 	function callThree()
   49: 	{
   50: 		try
   51: 		{
   52: 			$res = new Object();
   53: 			$this->three(1, 2, $res->getNone());
   54: 		}
   55: 		catch(Exception $e)
   56: 		{
   57: 			echo 'Caught: '.$e->getMessage()."\n";
   58: 		}
   59: 	}
   60: }
   61: 
   62: $p = new Proxy();
   63: 
   64: $p->callOne();
   65: $p->callTwo();
   66: $p->callThree();
   67: ?>
   68: ===DONE===
   69: --EXPECT--
   70: Caught: NONE
   71: Caught: NONE
   72: Caught: NONE
   73: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>