3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/fsd/fdstr/rtgd/file/upload/file.png'; $folder = dirname($path); $fileName = basename($path); $result = '/' . basename($folder) . '/' . $fileName; echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YblcW
function name:  (null)
number of ops:  18
compiled vars:  !0 = $path, !1 = $folder, !2 = $fileName, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Ffsd%2Ffdstr%2Frtgd%2Ffile%2Fupload%2Ffile.png'
    5     1        INIT_FCALL                                               'dirname'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5        INIT_FCALL                                               'basename'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
    8     9        INIT_FCALL                                               'basename'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     '%2F', $9
         13        CONCAT                                           ~11     ~10, '%2F'
         14        CONCAT                                           ~12     ~11, !2
         15        ASSIGN                                                   !3, ~12
   10    16        ECHO                                                     !3
   11    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1010 KiB | 15 Q