3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function getBar() { echo $this->$bar; } } (new Foo)->getBar();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Warning: Undefined variable $bar in /in/VquRe on line 9 Warning: Undefined property: Foo::$ in /in/VquRe on line 9
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: bar in /in/VquRe on line 9 Notice: Undefined property: Foo::$ in /in/VquRe on line 9
Output for 7.3.32 - 7.3.33
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.4.45, 5.5.24 - 5.5.35, 5.6.7 - 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.

preferences:
186.32 ms | 402 KiB | 246 Q