3v4l.org

run code in 300+ PHP versions simultaneously
<?php $storagedir = '/vagrant/www/resource-space/include/../filestore'; $dir_file_path = '/vagrant/www/resource-space/include/../filestore/2/4/0_ed2583e62f4dc12/240_b69bd79a9431acc.jpeg'; $filename_rootpath = ltrim(str_replace($storagedir, '', $dir_file_path), '/'); $filename = substr($filename_rootpath, (strrpos($filename_rootpath, '/') + 1)); $extension = substr($filename, (strrpos($filename, '.') + 1)); $return['file_path'] = rtrim(str_replace($filename, '', $filename_rootpath), '/'); $return['file_name'] = str_replace($filename, '', ".{$extension}"); var_dump($return);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NHrKF
function name:  (null)
number of ops:  56
compiled vars:  !0 = $storagedir, !1 = $dir_file_path, !2 = $filename_rootpath, !3 = $filename, !4 = $extension, !5 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fvagrant%2Fwww%2Fresource-space%2Finclude%2F..%2Ffilestore'
    4     1        ASSIGN                                                   !1, '%2Fvagrant%2Fwww%2Fresource-space%2Finclude%2F..%2Ffilestore%2F2%2F4%2F0_ed2583e62f4dc12%2F240_b69bd79a9431acc.jpeg'
    6     2        INIT_FCALL                                               'ltrim'
          3        INIT_FCALL                                               'str_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        SEND_VAR                                                 $8
          9        SEND_VAL                                                 '%2F'
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !2, $9
    7    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        INIT_FCALL                                               'strrpos'
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 '%2F'
         17        DO_ICALL                                         $11     
         18        ADD                                              ~12     $11, 1
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !3, $13
    8    22        INIT_FCALL                                               'substr'
         23        SEND_VAR                                                 !3
         24        INIT_FCALL                                               'strrpos'
         25        SEND_VAR                                                 !3
         26        SEND_VAL                                                 '.'
         27        DO_ICALL                                         $15     
         28        ADD                                              ~16     $15, 1
         29        SEND_VAL                                                 ~16
         30        DO_ICALL                                         $17     
         31        ASSIGN                                                   !4, $17
   11    32        INIT_FCALL                                               'rtrim'
         33        INIT_FCALL                                               'str_replace'
         34        SEND_VAR                                                 !3
         35        SEND_VAL                                                 ''
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $20     
         38        SEND_VAR                                                 $20
         39        SEND_VAL                                                 '%2F'
         40        DO_ICALL                                         $21     
         41        ASSIGN_DIM                                               !5, 'file_path'
         42        OP_DATA                                                  $21
   12    43        INIT_FCALL                                               'str_replace'
         44        SEND_VAR                                                 !3
         45        SEND_VAL                                                 ''
         46        NOP                                                      
         47        FAST_CONCAT                                      ~23     '.', !4
         48        SEND_VAL                                                 ~23
         49        DO_ICALL                                         $24     
         50        ASSIGN_DIM                                               !5, 'file_name'
         51        OP_DATA                                                  $24
   14    52        INIT_FCALL                                               'var_dump'
         53        SEND_VAR                                                 !5
         54        DO_ICALL                                                 
         55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.7 ms | 1400 KiB | 25 Q