3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; public function getBar() { echo $this->$bar; } } (new Foo)->getBar();
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: bar in /in/VquRe on line 9 Notice: Undefined property: Foo::$ in /in/VquRe on line 9
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: bar in /in/VquRe on line 9 Fatal error: Uncaught Error: Cannot access empty property in /in/VquRe:9 Stack trace: #0 /in/VquRe(14): Foo->getBar() #1 {main} thrown in /in/VquRe on line 9
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Undefined variable: bar in /in/VquRe on line 9 Fatal error: Cannot access empty property in /in/VquRe on line 9
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/VquRe on line 14
Process exited with code 255.