3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $name = 'CFE 2012 DECL INITIAL.pdf'; $extension = 'pdf'; $name = substr($name, 0, (strlen($name)-strlen($extension)-1)); var_dump($name);
based on X9bOD
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/BPvmc
function name:  (null)
number of ops:  16
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'
   7     2        INIT_FCALL                                               'substr'
         3        SEND_VAR                                                 !0
         4        SEND_VAL                                                 0
         5        STRLEN                                           ~4      !0
         6        STRLEN                                           ~5      !1
         7        SUB                                              ~6      ~4, ~5
         8        SUB                                              ~7      ~6, 1
         9        SEND_VAL                                                 ~7
        10        DO_ICALL                                         $8      
        11        ASSIGN                                                   !0, $8
  10    12        INIT_FCALL                                               'var_dump'
        13        SEND_VAR                                                 !0
        14        DO_ICALL                                                 
        15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0