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, 'self::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::self::test() in /in/OGmOG:13 Stack trace: #0 /in/OGmOG(20): Bar->__construct() #1 {main} thrown in /in/OGmOG on line 13
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected '(' in /in/OGmOG on line 12
Process exited with code 255.