3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function test() { echo "foo\n"; } } class Bar extends Foo { function __construct() { [$this, 'test'](); [$this, 'parent::test'](); } function test() { echo "bar\n"; } } new Bar;
based on 6XGEP
Output for 7.0.28 - 7.3.0rc3
bar Fatal error: Uncaught Error: Call to undefined method Bar::parent::test() in /in/Z0HId:13 Stack trace: #0 /in/Z0HId(19): Bar->__construct() #1 {main} thrown in /in/Z0HId on line 13
Process exited with code 255.
Output for hhvm-3.18.5 - 3.22.0
bar foo
Output for 5.6.30 - 5.6.38
Parse error: syntax error, unexpected '(' in /in/Z0HId on line 12
Process exited with code 255.