3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar extends PDO { public function baz() { parent::baz(); } } class PDO { public function baz() { echo __METHOD__; } } namespace Foo { class FooBar exnteds Bar { } } $bar = new Foo\Bar(); $bar->baz();
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'exnteds' (T_STRING), expecting '{' in /in/SssVh on line 21
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17
Fatal error: Namespace declaration statement has to be the very first statement in the script in /in/SssVh on line 20
Process exited with code 255.

preferences:
160.14 ms | 1395 KiB | 28 Q