3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Class Obj { public $property = 'Beauty beyond comare ...'; static function showP(){ echo $this->property; } } $z[0] = 'showP'; Obj::{$z[0]}();
based on 418KY
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/ZAPDI:7 Stack trace: #0 /in/ZAPDI(12): Obj::showP() #1 {main} thrown in /in/ZAPDI on line 7
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Using $this when not in object context in /in/ZAPDI on line 7
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '{', expecting T_STRING or T_VARIABLE or '$' in /in/ZAPDI on line 12
Process exited with code 255.