3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace abc; class b { } class a extends b { public function test(){ var_dump(self::class); } } $a = new \abc\a(); $a->test(); var_dump($a instanceof \abc\a::class);
based on G2iZ7
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting variable (T_VARIABLE) or '$' in /in/f5pfn on line 18
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_CLASS, expecting T_VARIABLE or T_PIPE_VAR or '$' in /in/f5pfn:18 Stack trace: #0 {main}
Process exited with code 255.