1--TEST--
2ReflectionProperty::getValue() on typed static property
3--FILE--
4<?php
5
6class Test {
7    public static int $x = 42;
8    public static int $y;
9    public static $z;
10}
11
12$rp = new ReflectionProperty('Test', 'x');
13var_dump($rp->getValue());
14
15$rp = new ReflectionProperty('Test', 'y');
16try {
17    var_dump($rp->getValue());
18} catch (Error $e) {
19    echo $e->getMessage(), "\n";
20}
21
22$rp->setValue("24");
23var_dump($rp->getValue());
24
25try {
26    $rp->setValue("foo");
27} catch (TypeError $e) {
28    echo $e->getMessage(), "\n";
29}
30var_dump($rp->getValue());
31
32Test::$z =& Test::$y;
33
34$rp = new ReflectionProperty('Test', 'z');
35try {
36    $rp->setValue("foo");
37} catch (TypeError $e) {
38    echo $e->getMessage(), "\n";
39}
40var_dump($rp->getValue());
41
42
43?>
44--EXPECT--
45int(42)
46Typed static property Test::$y must not be accessed before initialization
47int(24)
48Cannot assign string to property Test::$y of type int
49int(24)
50Cannot assign string to reference held by property Test::$y of type int
51int(24)
52