3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PMF_Filter { /** * Static wrapper method for filter_input() * * @param integer $type Filter type * @param string $variable_name Variable name * @param integer $filter Filter * @param mixed $default Default value * * @return mixed */ public static function filterInput ($type, $variable_name, $filter, $default = null) { $return = filter_input($type, $variable_name, $filter); return (is_null($return) || $return === false) ? $default : $return; } } $_GET["highlight"] = "foo"; $highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED); var_dump($highlight); if (!is_null($highlight) && $highlight != "/" && $highlight != "<" && $highlight != ">") { // && PMF_String::strlen($highlight) > 3 $highlight = str_replace("'", "ยด", $highlight); $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight); $highlight = preg_quote($highlight, '/'); $searchItems = explode(' ', $highlight); } var_dump($highlight); var_dump($searchItems);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 46
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 23
Branch analysis from position: 20
Branch analysis from position: 17
filename:       /in/TMB3U
function name:  (null)
number of ops:  53
compiled vars:  !0 = $highlight, !1 = $searchItems
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_W                      global              $2      '_GET'
          1        ASSIGN_DIM                                               $2, 'highlight'
          2        OP_DATA                                                  'foo'
   23     3        INIT_STATIC_METHOD_CALL                                  'PMF_Filter', 'filterInput'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 'highlight'
          6        SEND_VAL                                                 513
          7        DO_FCALL                                      0  $4      
          8        ASSIGN                                                   !0, $4
   25     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   28    12        TYPE_CHECK                                    2  ~7      !0
         13        BOOL_NOT                                         ~8      ~7
         14      > JMPZ_EX                                          ~8      ~8, ->17
         15    >   IS_NOT_EQUAL                                     ~9      !0, '%2F'
         16        BOOL                                             ~8      ~9
         17    > > JMPZ_EX                                          ~8      ~8, ->20
         18    >   IS_NOT_EQUAL                                     ~10     !0, '%3C'
         19        BOOL                                             ~8      ~10
         20    > > JMPZ_EX                                          ~8      ~8, ->23
         21    >   IS_NOT_EQUAL                                     ~11     !0, '%3E'
         22        BOOL                                             ~8      ~11
         23    > > JMPZ                                                     ~8, ->46
   29    24    >   INIT_FCALL                                               'str_replace'
         25        SEND_VAL                                                 '%27'
         26        SEND_VAL                                                 '%C2%B4'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $12     
         29        ASSIGN                                                   !0, $12
   30    30        INIT_FCALL                                               'str_replace'
         31        SEND_VAL                                                 <array>
         32        SEND_VAL                                                 ''
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $14     
         35        ASSIGN                                                   !0, $14
   31    36        INIT_FCALL                                               'preg_quote'
         37        SEND_VAR                                                 !0
         38        SEND_VAL                                                 '%2F'
         39        DO_ICALL                                         $16     
         40        ASSIGN                                                   !0, $16
   32    41        INIT_FCALL                                               'explode'
         42        SEND_VAL                                                 '+'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $18     
         45        ASSIGN                                                   !1, $18
   35    46    >   INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !0
         48        DO_ICALL                                                 
   36    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Class PMF_Filter:
Function filterinput:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/TMB3U
function name:  filterInput
number of ops:  20
compiled vars:  !0 = $type, !1 = $variable_name, !2 = $filter, !3 = $default, !4 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
   16     4        INIT_FCALL                                               'filter_input'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !4, $5
   17    10        TYPE_CHECK                                    2  ~7      !4
         11      > JMPNZ_EX                                         ~7      ~7, ->14
         12    >   TYPE_CHECK                                    4  ~8      !4
         13        BOOL                                             ~7      ~8
         14    > > JMPZ                                                     ~7, ->17
         15    >   QM_ASSIGN                                        ~9      !3
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~9      !4
         18    > > RETURN                                                   ~9
   18    19*     > RETURN                                                   null

End of function filterinput

End of class PMF_Filter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.75 ms | 1400 KiB | 23 Q