3v4l.org

run code in 500+ PHP versions simultaneously
<?php $x = [9,7,5,3,0]; $count = count($x) - 1; for ($pass = 0; $pass < $count; ++$pass) { for ($i = 0; $i < $count; ++$i) { if ($x[$i] > $x[$i + 1]) { [$x[$i + 1], $x[$i]] = [$x[$i], $x[$i + 1]]; } $results[] = implode($x); } $results[] = "\n"; } echo implode("\n", $results);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 6
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 8
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 6
Branch analysis from position: 37
Branch analysis from position: 6
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 8
Branch analysis from position: 32
Branch analysis from position: 8
Branch analysis from position: 26
filename:       /in/112gc
function name:  (null)
number of ops:  40
compiled vars:  !0 = $x, !1 = $count, !2 = $pass, !3 = $i, !4 = $results
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        COUNT                                                ~6      !0
          2        SUB                                                  ~7      ~6, 1
          3        ASSIGN                                                       !1, ~7
    5     4        ASSIGN                                                       !2, 0
          5      > JMP                                                          ->35
    6     6    >   ASSIGN                                                       !3, 0
          7      > JMP                                                          ->30
    7     8    >   FETCH_DIM_R                                          ~11     !0, !3
          9        ADD                                                  ~12     !3, 1
         10        FETCH_DIM_R                                          ~13     !0, ~12
         11        IS_SMALLER                                                   ~13, ~11
         12      > JMPZ                                                         ~14, ->26
    8    13    >   FETCH_DIM_R                                          ~15     !0, !3
         14        INIT_ARRAY                                           ~16     ~15
         15        ADD                                                  ~17     !3, 1
         16        FETCH_DIM_R                                          ~18     !0, ~17
         17        ADD_ARRAY_ELEMENT                                    ~16     ~18
         18        FETCH_LIST_R                                         $19     ~16, 0
         19        ADD                                                  ~20     !3, 1
         20        ASSIGN_DIM                                                   !0, ~20
         21        OP_DATA                                                      $19
         22        FETCH_LIST_R                                         $22     ~16, 1
         23        ASSIGN_DIM                                                   !0, !3
         24        OP_DATA                                                      $22
         25        FREE                                                         ~16
   10    26    >   FRAMELESS_ICALL_1                implode             ~25     !0
         27        ASSIGN_DIM                                                   !4
         28        OP_DATA                                                      ~25
    6    29        PRE_INC                                                      !3
         30    >   IS_SMALLER                                                   !3, !1
         31      > JMPNZ                                                        ~27, ->8
   12    32    >   ASSIGN_DIM                                                   !4
         33        OP_DATA                                                      '%0A'
    5    34        PRE_INC                                                      !2
         35    >   IS_SMALLER                                                   !2, !1
         36      > JMPNZ                                                        ~30, ->6
   14    37    >   FRAMELESS_ICALL_2                implode             ~31     '%0A', !4
         38        ECHO                                                         ~31
         39      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.43 ms | 2102 KiB | 13 Q