3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'var/log/some/other/directory/file.log'; $array = explode('/', $string); for ($c = count($array); $c > 0; ) { $output[--$c] = implode('/', $array); array_pop($array); } for ($i = 0; $i < count($output); $i++) { echo "$output[$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 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
Branch analysis from position: 20
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/4SPX3
function name:  (null)
number of ops:  29
compiled vars:  !0 = $string, !1 = $array, !2 = $c, !3 = $output, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'var%2Flog%2Fsome%2Fother%2Fdirectory%2Ffile.log'
    3     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%2F'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    4     6        COUNT                                                ~8      !1
          7        ASSIGN                                                       !2, ~8
          8      > JMP                                                          ->16
    5     9    >   PRE_DEC                                              ~10     !2
         10        FRAMELESS_ICALL_2                implode             ~12     '%2F', !1
         11        ASSIGN_DIM                                                   !3, ~10
         12        OP_DATA                                                      ~12
    6    13        INIT_FCALL                                                   'array_pop'
         14        SEND_REF                                                     !1
         15        DO_ICALL                                                     
    4    16    >   IS_SMALLER                                                   0, !2
         17      > JMPNZ                                                        ~14, ->9
    8    18    >   ASSIGN                                                       !4, 0
         19      > JMP                                                          ->25
    9    20    >   FETCH_DIM_R                                          ~16     !3, !4
         21        NOP                                                          
         22        FAST_CONCAT                                          ~17     ~16, '%0A'
         23        ECHO                                                         ~17
    8    24        PRE_INC                                                      !4
         25    >   COUNT                                                ~19     !3
         26        IS_SMALLER                                                   !4, ~19
         27      > JMPNZ                                                        ~20, ->20
   10    28    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.48 ms | 2122 KiB | 15 Q