3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class trial{ public $id; public static $sid; public function show(){ if (trial::sid) echo trial::sid; else echo $this->id; } } $obj = new trial(); $obj->id = 1; $obj->show();
based on h49iZ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Undefined class constant 'sid' in /in/Z7gg2:8 Stack trace: #0 /in/Z7gg2(15): trial->show() #1 {main} thrown in /in/Z7gg2 on line 8
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Undefined class constant 'sid' in /in/Z7gg2 on line 8
Process exited with code 255.