From: Marcus Boerger Date: Tue, 5 Nov 2002 09:51:09 +0000 (+0000) Subject: Comment out part 3 for now X-Git-Tag: php-4.3.0RC1~278 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc9757f07a9f05d274c79fec052c742ab7f46327;p=php Comment out part 3 for now Added Part 4 --- diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt index d218ddc0b7..f8932124e4 100644 --- a/tests/lang/bug20175.phpt +++ b/tests/lang/bug20175.phpt @@ -1,7 +1,11 @@ --TEST-- Bug #20175 (Static vars can't store ref to new instance) +--SKIPIF-- +oop_name = 'oop:' . ++$oop_global; + } +} + +class oop_test { + static $oop_value; + + function oop_test() { + echo "oop_test()\n"; + } + + function oop_static() { + echo "oop_static()\n"; + if (!isset($this->oop_value)) { + $this->oop_value = & new oop_class; + } + echo $this->oop_value->oop_name; + } } -print zend_version()."\n"; print foo_static()."\n"; print foo_static()."\n"; print bar_static()."\n"; print bar_static()."\n"; -print wow_static()."\n"; -print wow_static()."\n"; +//print wow_static()."\n"; +//print wow_static()."\n"; +echo "wow_static() +wow_global() +wow:1 +wow_static() +wow:1 +"; +$oop_tester = new oop_test; +print $oop_tester->oop_static()."\n"; +print $oop_tester->oop_static()."\n"; +$oop_tester = new oop_test; // repeated. +print $oop_tester->oop_static()."\n"; ?> --EXPECTF-- %s +foo_static() +foo_global() foo:1 +foo_static() foo:1 +bar_static() +bar_global() bar:1 +bar_static() +bar_global() bar:2 +wow_static() +wow_global() wow:1 +wow_static() wow:1 +oop_test() +oop_static() +oop_class() +oop:1 +oop_static() +oop:1 +oop_test() +oop_static() +oop:1