3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://www.php.net/manual/en/splfileinfo.getfilename.php */ $paths = array( '/path/to/', 'http://example.com/path/to/', 'http://example.com/path/' , 'http://example.com/' , 'http://' , 'http:/', ); foreach ($paths as $path) { $info = new SplFileInfo($path); printf( "%' -32s: %' -32s %' -12s %' -12s\n", $path, $info->getPathname() , $info->getBasename(), $info->getFilename() ); printf( "%' -32s %' -32s %' -12s", '', dirname($path), basename($path) ); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 34
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 34
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/3PBl8
function name:  (null)
number of ops:  36
compiled vars:  !0 = $paths, !1 = $path, !2 = $info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
   15     1      > FE_RESET_R                                       $4      !0, ->34
          2    > > FE_FETCH_R                                               $4, !1, ->34
   16     3    >   NEW                                              $5      'SplFileInfo'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $5
   18     7        INIT_FCALL                                               'printf'
   19     8        SEND_VAL                                                 '%25%27+-32s%3A+%25%27+-32s+%25%27+-12s+%25%27+-12s%0A'
          9        SEND_VAR                                                 !1
         10        INIT_METHOD_CALL                                         !2, 'getPathname'
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
   20    13        INIT_METHOD_CALL                                         !2, 'getBasename'
         14        DO_FCALL                                      0  $9      
         15        SEND_VAR                                                 $9
         16        INIT_METHOD_CALL                                         !2, 'getFilename'
         17        DO_FCALL                                      0  $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                                 
   22    20        INIT_FCALL                                               'printf'
   23    21        SEND_VAL                                                 '%25%27+-32s++%25%27+-32s+%25%27+-12s'
         22        SEND_VAL                                                 ''
         23        INIT_FCALL                                               'dirname'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $12     
         26        SEND_VAR                                                 $12
         27        INIT_FCALL                                               'basename'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $13     
         30        SEND_VAR                                                 $13
         31        DO_ICALL                                                 
   25    32        ECHO                                                     '%0A'
   15    33      > JMP                                                      ->2
         34    >   FE_FREE                                                  $4
   26    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.13 ms | 1396 KiB | 19 Q