3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'Happy^^^ hour^^ / is fun //'; function filenameEncode($possible_filename){ $fngood = str_replace(array('^',';','/',':'), array('^^',';;','^',';'), $possible_filename); return $fngood; } echo $s."\n"; echo filenameEncode($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XeSS8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Happy%5E%5E%5E+hour%5E%5E+%2F+is+fun+%2F%2F'
   11     1        CONCAT                                           ~2      !0, '%0A'
          2        ECHO                                                     ~2
   13     3        INIT_FCALL                                               'filenameencode'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
          7      > RETURN                                                   1

Function filenameencode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XeSS8
function name:  filenameEncode
number of ops:  9
compiled vars:  !0 = $possible_filename, !1 = $fngood
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
    7     7      > RETURN                                                   !1
    8     8*     > RETURN                                                   null

End of function filenameencode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.55 ms | 1389 KiB | 16 Q