From: Moriyoshi Koizumi Date: Sat, 15 Feb 2003 15:15:14 +0000 (+0000) Subject: Added test case for bug #22231 X-Git-Tag: RELEASE_0_5~1003 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b79da954c8d82793918c6b6675ef309f0efcbee;p=php Added test case for bug #22231 --- diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt new file mode 100644 index 0000000000..0d4d19d2e5 --- /dev/null +++ b/tests/lang/bug22231.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #22231 (segfault when returning a global variable by reference) +--FILE-- +fubar); +unset($bar); +$bar = &foo(); +var_dump($bar->fubar); + +$foo = &foo(); +var_dump($foo); +var_dump($foo->fubar); +unset($foo); +$foo = &foo(); +var_dump($foo->fubar); +?> +--EXPECT-- +object(foo)(1) { + ["fubar"]=> + string(5) "fubar" +} +string(5) "fubar" +string(5) "fubar" +object(foo)(1) { + ["fubar"]=> + string(5) "fubar" +} +string(5) "fubar" +string(5) "fubar"