3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X { private $t = 5; function fooX() { var_dump($this->t); }} class Y extends X { protected $t = 6; function fooY() { var_dump($this->t); } } var_dump(new Y); (new Y)->fooX(); (new Y)->fooY();
Output for 5.4.0 - 7.1.0, 7.1.6 - 7.2.0
object(Y)#1 (2) { ["t":protected]=> int(6) ["t":"X":private]=> int(5) } int(5) int(6)
Output for 7.1.5

Process exited with code 137.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/5bA2d on line 7
Process exited with code 255.