com php-src: Forgot to git add rope leak test: Zend/tests/rope _with_exception.phpt

From: Date: Sun, 28 Jun 2015 13:44:53 +0000
Subject: com php-src: Forgot to git add rope leak test: Zend/tests/rope _with_exception.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87574@lists.php.net to get a copy of this message
Commit: e96ad43ae6cc1f5e4db61cd52bf86198adaf77c1 Author: Bob Weinand <bobwei9@hotmail.com> Sun, 28 Jun 2015 15:44:53 +0200 Parents: 4a4529adb03a5e0d8c46809074a9bae37686e201 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e96ad43ae6cc1f5e4db61cd52bf86198adaf77c1 Log: Forgot to git add rope leak test Changed paths: A Zend/tests/rope_with_exception.phpt Diff: diff --git a/Zend/tests/rope_with_exception.phpt b/Zend/tests/rope_with_exception.phpt new file mode 100644 index 0000000..e73ea64 --- /dev/null +++ b/Zend/tests/rope_with_exception.phpt @@ -0,0 +1,52 @@ +--TEST-- +Exceptions thrown into a rope must not leak +--FILE-- +<?php + +class Obj { + function __get($x) { + throw new Exception(); + } +} + +try { + $x = new Obj; + $y = 0; + $r = "$y|$x->x|"; + echo "should never be reached"; +} catch (Exception $e) { + echo "$e\n"; +} + +try { + $x = new Obj; + $y = 0; + $r = "$y$x->x|"; + echo "should never be reached"; +} catch (Exception $e) { + echo "$e\n"; +} + +try { + $x = new Obj; + $y = 0; + $r = "$y|$y$x->x"; + echo "should never be reached"; +} catch (Exception $e) { + echo "$e\n"; +} + +?> +--EXPECTF-- +Exception in %s:%d +Stack trace: +#0 %s(%d): Obj->__get('x') +#1 {main} +Exception in %s:%d +Stack trace: +#0 %s(%d): Obj->__get('x') +#1 {main} +Exception in %s:%d +Stack trace: +#0 %s(%d): Obj->__get('x') +#1 {main}

« previous php.cvs (#87574) next »