3v4l.org

run code in 300+ PHP versions simultaneously
<?php $it = new ArrayIterator(array('zf9396', 'foo', null)); $it->rewind(); try { $it->seek(3); } catch (OutOfBoundsException $e) { var_dump($it->key()); $it->seek(0); var_dump($it->key()); } $lit = new LimitIterator($it, 0, 10); try { $lit->seek(3); } catch (OutOfBoundsException $e) { var_dump($lit->key()); $lit->seek(0); var_dump($lit->key()); }

preferences:
28.31 ms | 402 KiB | 5 Q