3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/a/b/c/d/config.ini'; $matches = preg_split('/\/|\\\/', $path); $filename = $matches[count($matches) - 1]; if(strpos($filename, '.') !== -1) { list($name, $ext) = explode('.', $filename); unset($matches[count($matches) - 1]); } $path = implode(DIRECTORY_SEPARATOR, $matches); var_dump($path, $name, $ext);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/BAr4l
function name:  (null)
number of ops:  39
compiled vars:  !0 = $path, !1 = $matches, !2 = $filename, !3 = $name, !4 = $ext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fa%2Fb%2Fc%2Fd%2Fconfig.ini'
    5     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%5C%2F%7C%5C%5C%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    7     6        COUNT                                            ~8      !1
          7        SUB                                              ~9      ~8, 1
          8        FETCH_DIM_R                                      ~10     !1, ~9
          9        ASSIGN                                                   !2, ~10
    9    10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 '.'
         13        DO_ICALL                                         $12     
         14        IS_NOT_IDENTICAL                                         $12, -1
         15      > JMPZ                                                     ~13, ->28
   10    16    >   INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '.'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $14     
         20        FETCH_LIST_R                                     $15     $14, 0
         21        ASSIGN                                                   !3, $15
         22        FETCH_LIST_R                                     $17     $14, 1
         23        ASSIGN                                                   !4, $17
         24        FREE                                                     $14
   11    25        COUNT                                            ~19     !1
         26        SUB                                              ~20     ~19, 1
         27        UNSET_DIM                                                !1, ~20
   14    28    >   INIT_FCALL                                               'implode'
         29        SEND_VAL                                                 '%2F'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !0, $21
   16    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !0
         35        SEND_VAR                                                 !3
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
209.45 ms | 1396 KiB | 23 Q