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