summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/typed_properties_107.phpt
blob: 776ad4fc9f62dc97f050096d7811f490e036e1fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Assigning stringable object to static string property
--FILE--
<?php

class Test1 {
    public static $ref;
}
class Test2 {
    public string $str = "str";
}
class Test3 {
    public function __toString() {
        $x = "foo";
        return $x . "bar";
    }
}

$test2 = new Test2;
Test1::$ref =& $test2->str;
Test1::$ref = new Test3;
var_dump(Test1::$ref);

?>
--EXPECT--
string(6) "foobar"