3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $a; public function __contruct($test) { $this->a = $test.'1'; } public function foo() { echo '$a is '.$this->$a; } } $x = new Test('test'); $x->foo(); ?>
based on fQaV0
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: a in /in/k7hPN on line 10 Notice: Undefined property: Test::$ in /in/k7hPN on line 10 $a is
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: a in /in/k7hPN on line 10 Fatal error: Uncaught Error: Cannot access empty property in /in/k7hPN:10 Stack trace: #0 /in/k7hPN(15): Test->foo() #1 {main} thrown in /in/k7hPN on line 10
Process exited with code 255.
Output for 5.3.19 - 5.6.21
Notice: Undefined variable: a in /in/k7hPN on line 10 Fatal error: Cannot access empty property in /in/k7hPN on line 10
Process exited with code 255.