3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $file_name = "PL1134-38 VSD hangtag order form 9.25-.xls"; $ndot = strrpos($file_name,"."); $extension = substr($file_name,$ndot); $prefixlength = strlen($file_name); alert($prefixlength); $prefix = $file_name.substr(0,$ndot); $prefix = str_replace(".","",$prefix); $file_name = ""; $file_name.= $prefix; $file_name.= $extension;
based on 4cHu5
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/LaE3d
function name:  (null)
number of ops:  32
compiled vars:  !0 = $file_name, !1 = $ndot, !2 = $extension, !3 = $prefixlength, !4 = $prefix
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, 'PL1134-38+VSD+hangtag+order+form+9.25-.xls'
   4     1        INIT_FCALL                                               'strrpos'
         2        SEND_VAR                                                 !0
         3        SEND_VAL                                                 '.'
         4        DO_ICALL                                         $6      
         5        ASSIGN                                                   !1, $6
   5     6        INIT_FCALL                                               'substr'
         7        SEND_VAR                                                 !0
         8        SEND_VAR                                                 !1
         9        DO_ICALL                                         $8      
        10        ASSIGN                                                   !2, $8
   6    11        STRLEN                                           ~10     !0
        12        ASSIGN                                                   !3, ~10
   7    13        INIT_FCALL_BY_NAME                                       'alert'
        14        SEND_VAR_EX                                              !3
        15        DO_FCALL                                      0          
   9    16        INIT_FCALL                                               'substr'
        17        SEND_VAL                                                 0
        18        SEND_VAR                                                 !1
        19        DO_ICALL                                         $13     
        20        CONCAT                                           ~14     !0, $13
        21        ASSIGN                                                   !4, ~14
  10    22        INIT_FCALL                                               'str_replace'
        23        SEND_VAL                                                 '.'
        24        SEND_VAL                                                 ''
        25        SEND_VAR                                                 !4
        26        DO_ICALL                                         $16     
        27        ASSIGN                                                   !4, $16
  12    28        ASSIGN                                                   !0, ''
  13    29        ASSIGN_CONCAT                                 0          !0, !4
  14    30        ASSIGN_CONCAT                                 0          !0, !2
        31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0