3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array(1,2,3,4); $total = count($numbers); $sum = 0; $output = ""; $i = 0; foreach($numbers as $number) { $i = $i + 1; if ($i < $total) { echo $number; $output = $number . $output; } } echo $output; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/oJQrH
function name:  (null)
number of ops:  19
compiled vars:  !0 = $numbers, !1 = $total, !2 = $sum, !3 = $output, !4 = $i, !5 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        COUNT                                            ~7      !0
          2        ASSIGN                                                   !1, ~7
    7     3        ASSIGN                                                   !2, 0
    9     4        ASSIGN                                                   !3, ''
   11     5        ASSIGN                                                   !4, 0
   13     6      > FE_RESET_R                                       $12     !0, ->16
          7    > > FE_FETCH_R                                               $12, !5, ->16
   15     8    >   ADD                                              ~13     !4, 1
          9        ASSIGN                                                   !4, ~13
   17    10        IS_SMALLER                                               !4, !1
         11      > JMPZ                                                     ~15, ->15
   19    12    >   ECHO                                                     !5
   21    13        CONCAT                                           ~16     !5, !3
         14        ASSIGN                                                   !3, ~16
   13    15    > > JMP                                                      ->7
         16    >   FE_FREE                                                  $12
   27    17        ECHO                                                     !3
   29    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.15 ms | 1393 KiB | 13 Q