3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface foo { public function getThing() : \Traversable; } class mything implements foo { public function getThing() : \ArrayIterator { return new \ArrayIterator([]); } } $xxx = new mything;
based on CmGe3
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Declaration of mything::getThing(): ArrayIterator must be compatible with foo::getThing(): Traversable in /in/OXL0o on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/OXL0o on line 4
Process exited with code 255.