3v4l.org

run code in 500+ PHP versions simultaneously
<?php $ait = new ArrayIterator(array('Value 1', 'Value 2', 'Value 3', 'Value 4')); $cit = new CachingIterator($ait); foreach ($cit as $value) { echo $value; //if has a next value, print a comma if ($cit->hasNext() && $cit->hasNext()) { echo ', '; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
Branch analysis from position: 17
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/P6icu
function name:  (null)
number of ops:  22
compiled vars:  !0 = $ait, !1 = $cit, !2 = $value
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        NEW                                                  $6      'CachingIterator'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
    6     8      > FE_RESET_R                                           $9      !1, ->20
          9    > > FE_FETCH_R                                                   $9, !2, ->20
    7    10    >   ECHO                                                         !2
    9    11        INIT_METHOD_CALL                                             !1, 'hasNext'
         12        DO_FCALL                                          0  $10     
         13      > JMPZ_EX                                              ~11     $10, ->17
         14    >   INIT_METHOD_CALL                                             !1, 'hasNext'
         15        DO_FCALL                                          0  $12     
         16        BOOL                                                 ~11     $12
         17    > > JMPZ                                                         ~11, ->19
   10    18    >   ECHO                                                         '%2C+'
    6    19    > > JMP                                                          ->9
         20    >   FE_FREE                                                      $9
   12    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.79 ms | 475 KiB | 7 Q