diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-06-28 15:44:53 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-06-28 15:44:53 +0200 |
commit | e96ad43ae6cc1f5e4db61cd52bf86198adaf77c1 (patch) | |
tree | 0654fca93aad71d758db869798c8a29e16788b3c | |
parent | 4a4529adb03a5e0d8c46809074a9bae37686e201 (diff) | |
download | php-git-e96ad43ae6cc1f5e4db61cd52bf86198adaf77c1.tar.gz |
Forgot to git add rope leak test
-rw-r--r-- | Zend/tests/rope_with_exception.phpt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Zend/tests/rope_with_exception.phpt b/Zend/tests/rope_with_exception.phpt new file mode 100644 index 0000000000..e73ea64518 --- /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} |