File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug48409.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 #48409 (crash when exception is thrown while passing function arguments)
    3: --FILE--
    4: <?php
    5: 
    6: class ABCException extends Exception {}
    7: 
    8: class BBB
    9: {
   10: 	public function xyz($d, $x)
   11: 	{
   12: 		if ($x == 34) {
   13: 			throw new ABCException;
   14: 		}
   15: 		return array('foo' => 'xyz');
   16: 	}
   17: }
   18: 	
   19: class CCC
   20: {
   21: 	public function process($p)
   22: 	{
   23: 		return $p;
   24: 	}
   25: }
   26: 
   27: class AAA
   28: {
   29: 	public function func()
   30: 	{
   31: 		$b = new BBB;
   32: 		$c = new CCC;
   33: 		$i = 34;
   34: 		$item = array('foo' => 'bar');
   35: 		try {
   36: 			$c->process($b->xyz($item['foo'], $i));
   37: 		}
   38: 		catch(ABCException $e) {
   39: 			$b->xyz($item['foo'], $i);
   40: 		}
   41: 	} // end func();
   42: }
   43: 
   44: class Runner
   45: {
   46: 	public function run($x)
   47: 	{
   48: 		try {
   49: 			$x->func();
   50: 		}
   51: 		catch(ABCException $e) {
   52: 			throw new Exception;
   53: 		}
   54: 	}
   55: }
   56: 
   57: try {
   58: 	$runner = new Runner;
   59: 	$runner->run(new AAA);
   60: }
   61: catch(Exception $e) {
   62: 	die('Exception thrown');
   63: }
   64: 
   65: ?>
   66: --EXPECT--
   67: Exception thrown

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