3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_array = array('Element 1', 'Element 2', 'Element 3', 'Element 4', 'Element 5', 'Element 6'); $infArray = array(1, 2, 3); $arrayIterator = new ArrayIterator($infArray); $infiniteIterator = new InfiniteIterator(new ArrayIterator($infArray)); //var_dump($infiniteIterator->current()); foreach($test_array as $test){ echo $test . ' ' . $infiniteIterator->current() . '<br/>' . PHP_EOL; $infiniteIterator->next(); } echo phpversion();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/ndYZ3
function name:  (null)
number of ops:  30
compiled vars:  !0 = $test_array, !1 = $infArray, !2 = $arrayIterator, !3 = $infiniteIterator, !4 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        NEW                                              $7      'ArrayIterator'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $7
    7     6        NEW                                              $10     'InfiniteIterator'
          7        NEW                                              $11     'ArrayIterator'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $11
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !3, $10
   10    13      > FE_RESET_R                                       $15     !0, ->25
         14    > > FE_FETCH_R                                               $15, !4, ->25
   11    15    >   CONCAT                                           ~16     !4, '+'
         16        INIT_METHOD_CALL                                         !3, 'current'
         17        DO_FCALL                                      0  $17     
         18        CONCAT                                           ~18     ~16, $17
         19        CONCAT                                           ~19     ~18, '%3Cbr%2F%3E'
         20        CONCAT                                           ~20     ~19, '%0A'
         21        ECHO                                                     ~20
   12    22        INIT_METHOD_CALL                                         !3, 'next'
         23        DO_FCALL                                      0          
   10    24      > JMP                                                      ->14
         25    >   FE_FREE                                                  $15
   15    26        INIT_FCALL                                               'phpversion'
         27        DO_ICALL                                         $22     
         28        ECHO                                                     $22
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.06 ms | 1400 KiB | 15 Q