]> granicus.if.org Git - php/commitdiff
Add test case for bug #26866
authorfoobar <sniper@php.net>
Tue, 10 Feb 2004 12:58:36 +0000 (12:58 +0000)
committerfoobar <sniper@php.net>
Tue, 10 Feb 2004 12:58:36 +0000 (12:58 +0000)
tests/lang/bug26866.phpt [new file with mode: 0644]

diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt
new file mode 100644 (file)
index 0000000..abb99c3
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+Bug #26866 (segfault when exception raised in __get)
+--FILE--
+<?php
+class bar {
+       function get_name() {
+               return 'bar';
+       }
+}
+class foo {
+       function __get($sName) {
+               throw new Exception('Exception!');
+               return new bar();
+       }
+}
+$foo = new foo();
+try {
+       echo $foo->bar->get_name();
+}
+catch (Exception $E) {
+       echo "Exception raised!\n";
+}
+?>
+--EXPECT--
+Exception raised!