3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clean_string($s){ $r=trim($s); $r=stripslashes($r); $r=str_replace('?','',$r); $r=str_replace('\'','-',$r); $r=str_replace('/','-',$r); $r=str_replace(' ','-',$r); $r=str_replace('(','',$r); $r=str_replace(')','',$r); $r=str_replace('"','',$r); $r=str_replace('/','-',$r); $r=ereg_replace('-+','-',$r); $r=htmlentities(strtolower($r)); return $r; } echo clean_string('Harry&Henk in het bos');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EDZ2d
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'clean_string'
          1        SEND_VAL                                                 'Harry%26Henk+in+het+bos'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function clean_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EDZ2d
function name:  clean_string
number of ops:  72
compiled vars:  !0 = $s, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    4     5        INIT_FCALL                                               'stripslashes'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    5     9        INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '%3F'
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !1, $6
    6    15        INIT_FCALL                                               'str_replace'
         16        SEND_VAL                                                 '%27'
         17        SEND_VAL                                                 '-'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $8      
         20        ASSIGN                                                   !1, $8
    7    21        INIT_FCALL                                               'str_replace'
         22        SEND_VAL                                                 '%2F'
         23        SEND_VAL                                                 '-'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $10     
         26        ASSIGN                                                   !1, $10
    8    27        INIT_FCALL                                               'str_replace'
         28        SEND_VAL                                                 '+'
         29        SEND_VAL                                                 '-'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $12     
         32        ASSIGN                                                   !1, $12
    9    33        INIT_FCALL                                               'str_replace'
         34        SEND_VAL                                                 '%28'
         35        SEND_VAL                                                 ''
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $14     
         38        ASSIGN                                                   !1, $14
   10    39        INIT_FCALL                                               'str_replace'
         40        SEND_VAL                                                 '%29'
         41        SEND_VAL                                                 ''
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                         $16     
         44        ASSIGN                                                   !1, $16
   11    45        INIT_FCALL                                               'str_replace'
         46        SEND_VAL                                                 '%22'
         47        SEND_VAL                                                 ''
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                         $18     
         50        ASSIGN                                                   !1, $18
   12    51        INIT_FCALL                                               'str_replace'
         52        SEND_VAL                                                 '%2F'
         53        SEND_VAL                                                 '-'
         54        SEND_VAR                                                 !1
         55        DO_ICALL                                         $20     
         56        ASSIGN                                                   !1, $20
   13    57        INIT_FCALL_BY_NAME                                       'ereg_replace'
         58        SEND_VAL_EX                                              '-%2B'
         59        SEND_VAL_EX                                              '-'
         60        SEND_VAR_EX                                              !1
         61        DO_FCALL                                      0  $22     
         62        ASSIGN                                                   !1, $22
   14    63        INIT_FCALL                                               'htmlentities'
         64        INIT_FCALL                                               'strtolower'
         65        SEND_VAR                                                 !1
         66        DO_ICALL                                         $24     
         67        SEND_VAR                                                 $24
         68        DO_ICALL                                         $25     
         69        ASSIGN                                                   !1, $25
   15    70      > RETURN                                                   !1
   16    71*     > RETURN                                                   null

End of function clean_string

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.26 ms | 1403 KiB | 24 Q