3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FooIterator extends ArrayIterator { public function current() { return 'herpderp'; } } $a = [1,2,3]; next($a); var_dump(current($a)); rewind($a); var_dump(current($a));
based on 7DZuZ
Output for 5.4.1 - 7.2.0
int(2) Warning: rewind() expects parameter 1 to be resource, array given in /in/2Koi2 on line 12 int(2)
Output for 5.3.12 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/2Koi2 on line 9
Process exited with code 255.