3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface SomeInterface { public function addSomething($something) : null; public function getSomeInterface() : SomeInterface; } class SomeClass implements SomeInterface { public function getSomeInterface() : SomeInterface { debug_print_backtrace(); return $this; } } $object = new SomeClass(); var_dump($object->getSomeInterface());
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/WklBe on line 6
Process exited with code 255.

preferences:
188.08 ms | 1400 KiB | 67 Q