3v4l.org

run code in 300+ PHP versions simultaneously
<?php function path_components($path) { $components = array(); while ($path != "." && $path != "/") { array_unshift($components, basename($path)); $path = dirname($path); } return $components; } var_dump(path_components("a/b/c"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3j7td
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'path_components'
          2        SEND_VAL                                                 'a%2Fb%2Fc'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function path_components:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/3j7td
function name:  path_components
number of ops:  21
compiled vars:  !0 = $path, !1 = $components
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2      > JMP                                                      ->14
    8     3    >   INIT_FCALL                                               'array_unshift'
          4        SEND_REF                                                 !1
          5        INIT_FCALL                                               'basename'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
    9    10        INIT_FCALL                                               'dirname'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !0, $5
    6    14    >   IS_NOT_EQUAL                                     ~7      !0, '.'
         15      > JMPZ_EX                                          ~7      ~7, ->18
         16    >   IS_NOT_EQUAL                                     ~8      !0, '%2F'
         17        BOOL                                             ~7      ~8
         18    > > JMPNZ                                                    ~7, ->3
   12    19    > > RETURN                                                   !1
   13    20*     > RETURN                                                   null

End of function path_components

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.8 ms | 1398 KiB | 22 Q