3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mb_pathinfo($filepath) { preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im',$filepath,$m); if($m[1]) $ret['dirname']=$m[1]; if($m[2]) $ret['basename']=$m[2]; if($m[5]) $ret['extension']=$m[5]; if($m[3]) $ret['filename']=$m[3]; return $ret; } print_r(mb_pathinfo("/mnt/files/飛兒樂團光茫.mp3"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NlB55
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'mb_pathinfo'
          2        SEND_VAL                                                 '%2Fmnt%2Ffiles%2F%E9%A3%9B%E5%85%92%E6%A8%82%E5%9C%98%E5%85%89%E8%8C%AB.mp3'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function mb_pathinfo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 21
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/NlB55
function name:  mb_pathinfo
number of ops:  28
compiled vars:  !0 = $filepath, !1 = $m, !2 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%25%5E%28.%2A%3F%29%5B%5C%5C%2F%5D%2A%28%28%5B%5E%2F%5C%5C%5D%2A%3F%29%28%5C.%28%5B%5E%5C.%5C%5C%2F%5D%2B%3F%29%7C%29%29%5B%5C%5C%2F%5C.%5D%2A%24%25im'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    4     6        FETCH_DIM_R                                      ~4      !1, 1
          7      > JMPZ                                                     ~4, ->11
          8    >   FETCH_DIM_R                                      ~6      !1, 1
          9        ASSIGN_DIM                                               !2, 'dirname'
         10        OP_DATA                                                  ~6
    5    11    >   FETCH_DIM_R                                      ~7      !1, 2
         12      > JMPZ                                                     ~7, ->16
         13    >   FETCH_DIM_R                                      ~9      !1, 2
         14        ASSIGN_DIM                                               !2, 'basename'
         15        OP_DATA                                                  ~9
    6    16    >   FETCH_DIM_R                                      ~10     !1, 5
         17      > JMPZ                                                     ~10, ->21
         18    >   FETCH_DIM_R                                      ~12     !1, 5
         19        ASSIGN_DIM                                               !2, 'extension'
         20        OP_DATA                                                  ~12
    7    21    >   FETCH_DIM_R                                      ~13     !1, 3
         22      > JMPZ                                                     ~13, ->26
         23    >   FETCH_DIM_R                                      ~15     !1, 3
         24        ASSIGN_DIM                                               !2, 'filename'
         25        OP_DATA                                                  ~15
    8    26    > > RETURN                                                   !2
    9    27*     > RETURN                                                   null

End of function mb_pathinfo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.48 ms | 1403 KiB | 18 Q