mirror of
https://github.com/php/php-src.git
synced 2024-10-17 06:22:53 +00:00
19 lines
311 B
Plaintext
19 lines
311 B
Plaintext
|
--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) {
|
||
|
}
|