1--TEST--
2Test typed references to static properties
3--FILE--
4<?php
5
6class Test {
7	public static int $x = 0;
8}
9
10class Test2 extends Test {
11	public static $y = 1;
12}
13
14$x =& Test::$x;
15try {
16	$x = "foo";
17} catch (TypeError $e) { echo $e->getMessage(), "\n"; }
18var_dump($x, Test::$x);
19
20Test::$x =& Test2::$y; // remove the typed ref from $x
21$x = "foo";
22var_dump($x, Test::$x);
23
24?>
25--EXPECT--
26Cannot assign string to reference held by property Test::$x of type int
27int(0)
28int(0)
29string(3) "foo"
30int(1)
31