summaryrefslogtreecommitdiff
path: root/Zend/tests/bug42772.phpt
blob: 8887bdbd7e9e4ea43ff98fc06a0fa6396e1ea3e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--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) {
}