3v4l.org

run code in 300+ PHP versions simultaneously
<?php $width = 5; foreach (range(1, $width) as $i) { printf("%{$width}s\n", join(array_reverse(range(1, $i)))); } $width = 5; foreach (range(1, $width) as $i) { printf("%{$width}s\n", join(array(range(1, $i)))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 49
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 49
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 25
filename:       /in/hL4I4
function name:  (null)
number of ops:  51
compiled vars:  !0 = $width, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    5     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5      > FE_RESET_R                                       $4      $3, ->25
          6    > > FE_FETCH_R                                               $4, !1, ->25
    6     7    >   INIT_FCALL                                               'printf'
          8        ROPE_INIT                                     3  ~6      '%25'
          9        ROPE_ADD                                      1  ~6      ~6, !0
         10        ROPE_END                                      2  ~5      ~6, 's%0A'
         11        SEND_VAL                                                 ~5
         12        INIT_FCALL                                               'join'
         13        INIT_FCALL                                               'array_reverse'
         14        INIT_FCALL                                               'range'
         15        SEND_VAL                                                 1
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                                 
    5    24      > JMP                                                      ->6
         25    >   FE_FREE                                                  $4
    9    26        ASSIGN                                                   !0, 5
   10    27        INIT_FCALL                                               'range'
         28        SEND_VAL                                                 1
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $13     
         31      > FE_RESET_R                                       $14     $13, ->49
         32    > > FE_FETCH_R                                               $14, !1, ->49
   11    33    >   INIT_FCALL                                               'printf'
         34        ROPE_INIT                                     3  ~16     '%25'
         35        ROPE_ADD                                      1  ~16     ~16, !0
         36        ROPE_END                                      2  ~15     ~16, 's%0A'
         37        SEND_VAL                                                 ~15
         38        INIT_FCALL                                               'join'
         39        INIT_FCALL                                               'range'
         40        SEND_VAL                                                 1
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $18     
         43        INIT_ARRAY                                       ~19     $18
         44        SEND_VAL                                                 ~19
         45        DO_ICALL                                         $20     
         46        SEND_VAR                                                 $20
         47        DO_ICALL                                                 
   10    48      > JMP                                                      ->32
         49    >   FE_FREE                                                  $14
   12    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1400 KiB | 21 Q