3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/a/b/c/d/e.f'; $matches = []; $matches = preg_split('/\/|\\\/', $path); var_dump($matches); echo $matches[count($matches) - 1];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BGquT
function name:  (null)
number of ops:  15
compiled vars:  !0 = $path, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fa%2Fb%2Fc%2Fd%2Fe.f'
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%2F%5C%2F%7C%5C%5C%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    9     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   11    10        COUNT                                            ~7      !1
         11        SUB                                              ~8      ~7, 1
         12        FETCH_DIM_R                                      ~9      !1, ~8
         13        ECHO                                                     ~9
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.16 ms | 1394 KiB | 17 Q