3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface A extends Traversable { } class C implements A, Iterator { /** * (PHP 5 &gt;= 5.0.0)<br/> * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ public function current() { // TODO: Implement current() method. } /** * (PHP 5 &gt;= 5.0.0)<br/> * Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next() { // TODO: Implement next() method. } /** * (PHP 5 &gt;= 5.0.0)<br/> * Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ public function key() { // TODO: Implement key() method. } /** * (PHP 5 &gt;= 5.0.0)<br/> * Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return boolean The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid() { // TODO: Implement valid() method. } /** * (PHP 5 &gt;= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind() { // TODO: Implement rewind() method. } } $c = new C();
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Fatal error: Class C must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/uceDV on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/uceDV on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/uceDV on line 3
Process exited with code 255.