3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'CFE 2012 DECL INITIAL.pdf'; $extension = 'pdf'; if (substr($name, -strlen($extension)) == $extension) { $name = str_replace('.'.$extension, '', $name); } var_dump($name);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/sCWKp
function name:  (null)
number of ops:  21
compiled vars:  !0 = $name, !1 = $extension
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'CFE+2012+DECL+INITIAL.pdf'
    4     1        ASSIGN                                                   !1, 'pdf'
    6     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        STRLEN                                           ~4      !1
          5        MUL                                              ~5      ~4, -1
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        IS_EQUAL                                                 !1, $6
          9      > JMPZ                                                     ~7, ->17
    7    10    >   INIT_FCALL                                               'str_replace'
         11        CONCAT                                           ~8      '.', !1
         12        SEND_VAL                                                 ~8
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !0, $9
   10    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.21 ms | 1386 KiB | 19 Q