3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'H', 'E', 'L', 'L', 'O', ]; $string = implode("", $array); for ($i = 0; $i <= count($array); $i++) { echo substr($string, 0, $i)."\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/ibXpK
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $string, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   11     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->16
   12     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      $7, '%0A'
         14        ECHO                                                     ~8
   11    15        PRE_INC                                                  !2
         16    >   COUNT                                            ~10     !0
         17        IS_SMALLER_OR_EQUAL                                      !2, ~10
         18      > JMPNZ                                                    ~11, ->8
   13    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
236.46 ms | 953 KiB | 15 Q