1--TEST-- 2Attempting to access static properties using instance property syntax 3--FILE-- 4<?php 5#[AllowDynamicProperties] 6class C { 7 public static $x = 'C::$x'; 8 protected static $y = 'C::$y'; 9} 10 11$c = new C; 12 13echo "\n--> Access visible static prop like instance prop:\n"; 14var_dump(isset($c->x)); 15unset($c->x); 16echo $c->x; 17$c->x = 1; 18$ref = 'ref'; 19$c->x =& $ref; 20var_dump($c->x, C::$x); 21 22echo "\n--> Access non-visible static prop like instance prop:\n"; 23var_dump(isset($c->y)); 24//unset($c->y); // Fatal error, tested in static_properties_003_error1.phpt 25//echo $c->y; // Fatal error, tested in static_properties_003_error2.phpt 26//$c->y = 1; // Fatal error, tested in static_properties_003_error3.phpt 27//$c->y =& $ref; // Fatal error, tested in static_properties_003_error4.phpt 28?> 29--EXPECTF-- 30--> Access visible static prop like instance prop: 31bool(false) 32 33Notice: Accessing static property C::$x as non static in %s on line 12 34 35Notice: Accessing static property C::$x as non static in %s on line 13 36 37Warning: Undefined property: C::$x in %s on line %d 38 39Notice: Accessing static property C::$x as non static in %s on line 14 40 41Notice: Accessing static property C::$x as non static in %s on line 16 42 43Notice: Accessing static property C::$x as non static in %s on line 17 44string(3) "ref" 45string(5) "C::$x" 46 47--> Access non-visible static prop like instance prop: 48bool(false) 49