3v4l.org

run code in 500+ 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->rewind(); var_dump($it->key()); } $lit = new LimitIterator($it, 0, 10); try { $lit->seek(3); } catch (OutOfBoundsException $e) { var_dump($lit->key()); $lit->rewind(); var_dump($lit->key()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
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 = 46
Branch analysis from position: 46
Found catch point at position: 33
Branch analysis from position: 33
2 jumps found. (Code = 107) Position 1 = 34, Position 2 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PT2qW
function name:  (null)
number of ops:  47
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                                                          ->23
    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, 'rewind'
         17        DO_FCALL                                          0          
   11    18        INIT_FCALL                                                   'var_dump'
         19        INIT_METHOD_CALL                                             !0, 'key'
         20        DO_FCALL                                          0  $11     
         21        SEND_VAR                                                     $11
         22        DO_ICALL                                                     
   15    23    >   NEW                                                  $13     'LimitIterator'
         24        SEND_VAR_EX                                                  !0
         25        SEND_VAL_EX                                                  0
         26        SEND_VAL_EX                                                  10
         27        DO_FCALL                                          0          
         28        ASSIGN                                                       !2, $13
   17    29        INIT_METHOD_CALL                                             !2, 'seek'
         30        SEND_VAL_EX                                                  3
         31        DO_FCALL                                          0          
         32      > JMP                                                          ->46
   18    33  E > > CATCH                                           last         'OutOfBoundsException'
   19    34    >   INIT_FCALL                                                   'var_dump'
         35        INIT_METHOD_CALL                                             !2, 'key'
         36        DO_FCALL                                          0  $17     
         37        SEND_VAR                                                     $17
         38        DO_ICALL                                                     
   20    39        INIT_METHOD_CALL                                             !2, 'rewind'
         40        DO_FCALL                                          0          
   21    41        INIT_FCALL                                                   'var_dump'
         42        INIT_METHOD_CALL                                             !2, 'key'
         43        DO_FCALL                                          0  $20     
         44        SEND_VAR                                                     $20
         45        DO_ICALL                                                     
   22    46    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.63 ms | 1997 KiB | 14 Q