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()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Found catch point at position: 34
Branch analysis from position: 34
2 jumps found. (Code = 107) Position 1 = 35, Position 2 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9DrgU
function name:  (null)
number of ops:  49
compiled vars:  !0 = $it, !1 = $e, !2 = $lit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        INIT_METHOD_CALL                                         !0, 'rewind'
          5        DO_FCALL                                      0          
    7     6        INIT_METHOD_CALL                                         !0, 'seek'
          7        SEND_VAL_EX                                              3
          8        DO_FCALL                                      0          
          9      > JMP                                                      ->24
    8    10  E > > CATCH                                       last         'OutOfBoundsException'
    9    11    >   INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !0, 'key'
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
   10    16        INIT_METHOD_CALL                                         !0, 'seek'
         17        SEND_VAL_EX                                              0
         18        DO_FCALL                                      0          
   11    19        INIT_FCALL                                               'var_dump'
         20        INIT_METHOD_CALL                                         !0, 'key'
         21        DO_FCALL                                      0  $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                                 
   15    24    >   NEW                                              $13     'LimitIterator'
         25        SEND_VAR_EX                                              !0
         26        SEND_VAL_EX                                              0
         27        SEND_VAL_EX                                              10
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !2, $13
   17    30        INIT_METHOD_CALL                                         !2, 'seek'
         31        SEND_VAL_EX                                              3
         32        DO_FCALL                                      0          
         33      > JMP                                                      ->48
   18    34  E > > CATCH                                       last         'OutOfBoundsException'
   19    35    >   INIT_FCALL                                               'var_dump'
         36        INIT_METHOD_CALL                                         !2, 'key'
         37        DO_FCALL                                      0  $17     
         38        SEND_VAR                                                 $17
         39        DO_ICALL                                                 
   20    40        INIT_METHOD_CALL                                         !2, 'seek'
         41        SEND_VAL_EX                                              0
         42        DO_FCALL                                      0          
   21    43        INIT_FCALL                                               'var_dump'
         44        INIT_METHOD_CALL                                         !2, 'key'
         45        DO_FCALL                                      0  $20     
         46        SEND_VAR                                                 $20
         47        DO_ICALL                                                 
   22    48    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.78 ms | 1400 KiB | 15 Q