3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class trial{ public $id; //public static $id; public function show(){ echo $this->$id; } } $obj = new trial(); $obj->id = 1; $obj->show();
based on gTNb6
Output for 7.1.0 - 7.3.0
Notice: Undefined variable: id in /in/1iYZD on line 8 Notice: Undefined property: trial::$ in /in/1iYZD on line 8
Output for 7.0.0 - 7.0.33
Notice: Undefined variable: id in /in/1iYZD on line 8 Fatal error: Uncaught Error: Cannot access empty property in /in/1iYZD:8 Stack trace: #0 /in/1iYZD(14): trial->show() #1 {main} thrown in /in/1iYZD on line 8
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Undefined variable: id in /in/1iYZD on line -1 Notice: Undefined variable: id in /in/1iYZD on line -1 Fatal error: Uncaught Error: Cannot access empty property in /in/1iYZD:-1 Stack trace: #0 /in/1iYZD(-1): trial->show() #1 {main}
Process exited with code 255.
Output for hhvm-3.13.2 - 3.21.3
Notice: Undefined variable: id in /in/1iYZD on line 8 Notice: Undefined variable: id in /in/1iYZD on line 8 Fatal error: Uncaught Error: Cannot access empty property in /in/1iYZD:8 Stack trace: #0 /in/1iYZD(14): trial->show() #1 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.12.14
Fatal error: Uncaught Error: Cannot access empty property in /in/1iYZD:8 Stack trace: #0 /in/1iYZD(14): trial->show() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Cannot access empty property in /in/1iYZD on line 8
Process exited with code 255.
Output for 5.3.18 - 5.6.38
Notice: Undefined variable: id in /in/1iYZD on line 8 Fatal error: Cannot access empty property in /in/1iYZD on line 8
Process exited with code 255.