You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
311 B

--TEST--
Bug #42772 (Storing $this in a static var fails while handling a cast to string)
--FILE--
<?php
class Foo {
static public $foo;
function __toString() {
self::$foo = $this;
return 'foo';
}
}
$foo = (string)new Foo();
var_dump(Foo::$foo);
?>
--EXPECT--
object(Foo)#1 (0) {
}