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 . "X"; $output = $number . $output; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/EjIqA
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, ->17
          7    > > FE_FETCH_R                                               $12, !5, ->17
   15     8    >   ADD                                              ~13     !4, 1
          9        ASSIGN                                                   !4, ~13
   17    10        IS_SMALLER                                               !4, !1
         11      > JMPZ                                                     ~15, ->16
   19    12    >   CONCAT                                           ~16     !5, 'X'
         13        ECHO                                                     ~16
   21    14        CONCAT                                           ~17     !5, !3
         15        ASSIGN                                                   !3, ~17
   13    16    > > JMP                                                      ->7
         17    >   FE_FREE                                                  $12
   27    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.76 ms | 1398 KiB | 13 Q