Return to bug42772.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests |
1.1 misho 1: --TEST-- 2: Bug #42772 (Storing $this in a static var fails while handling a cast to string) 3: --FILE-- 4: <?php 5: class Foo { 6: static public $foo; 7: function __toString() { 8: self::$foo = $this; 9: return 'foo'; 10: } 11: } 12: 13: $foo = (string)new Foo(); 14: var_dump(Foo::$foo); 15: ?> 16: --EXPECT-- 17: object(Foo)#1 (0) { 18: }