3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myIt = new ArrayIterator(range( 0, 50)); $myIt->seek(20); echo $myIt->current(), "\n"; // out: 1 expected 20 $myIt->seek(5000); // ? out of bounds but no error or Exception
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LNU3U
function name:  (null)
number of ops:  19
compiled vars:  !0 = $myIt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'ArrayIterator'
          1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 50
          4        DO_ICALL                                         $2      
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $1
    4     8        INIT_METHOD_CALL                                         !0, 'seek'
          9        SEND_VAL_EX                                              20
         10        DO_FCALL                                      0          
    6    11        INIT_METHOD_CALL                                         !0, 'current'
         12        DO_FCALL                                      0  $6      
         13        ECHO                                                     $6
         14        ECHO                                                     '%0A'
    8    15        INIT_METHOD_CALL                                         !0, 'seek'
         16        SEND_VAL_EX                                              5000
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.93 ms | 1394 KiB | 15 Q