3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { private $a = 'foo'; protected a() { return $this->a; } } class B extends A { function f() { echo $this->a; } function f2() { echo $this->a(); } } $b = new B; $b->f(); $b->f2();
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected 'a' (T_STRING), expecting variable (T_VARIABLE) in /in/v6eOa on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/v6eOa on line 4
Process exited with code 255.