3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_file_name($name) { return ((basename($name) == $name) && (substr($name, 1, 1) != '.')); } echo check_file_name('rere.fdf'); echo check_file_name('/rere.fdf'); echo check_file_name('.');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qcc7B
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'check_file_name'
          1        SEND_VAL                                                 'rere.fdf'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
    8     4        INIT_FCALL                                               'check_file_name'
          5        SEND_VAL                                                 '%2Frere.fdf'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
    9     8        INIT_FCALL                                               'check_file_name'
          9        SEND_VAL                                                 '.'
         10        DO_FCALL                                      0  $2      
         11        ECHO                                                     $2
         12      > RETURN                                                   1

Function check_file_name:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/qcc7B
function name:  check_file_name
number of ops:  15
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'basename'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        IS_EQUAL                                         ~2      !0, $1
          5      > JMPZ_EX                                          ~2      ~2, ->13
          6    >   INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 1
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $3      
         11        IS_NOT_EQUAL                                     ~4      $3, '.'
         12        BOOL                                             ~2      ~4
         13    > > RETURN                                                   ~2
    5    14*     > RETURN                                                   null

End of function check_file_name

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.89 ms | 1399 KiB | 20 Q