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; } } //$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED); $highlight = "foo"; 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 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 38
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 15
Branch analysis from position: 12
Branch analysis from position: 9
filename:       /in/eZ9kY
function name:  (null)
number of ops:  45
compiled vars:  !0 = $highlight, !1 = $searchItems
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, 'foo'
   26     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   29     4        TYPE_CHECK                                    2  ~4      !0
          5        BOOL_NOT                                         ~5      ~4
          6      > JMPZ_EX                                          ~5      ~5, ->9
          7    >   IS_NOT_EQUAL                                     ~6      !0, '%2F'
          8        BOOL                                             ~5      ~6
          9    > > JMPZ_EX                                          ~5      ~5, ->12
         10    >   IS_NOT_EQUAL                                     ~7      !0, '%3C'
         11        BOOL                                             ~5      ~7
         12    > > JMPZ_EX                                          ~5      ~5, ->15
         13    >   IS_NOT_EQUAL                                     ~8      !0, '%3E'
         14        BOOL                                             ~5      ~8
         15    > > JMPZ                                                     ~5, ->38
   30    16    >   INIT_FCALL                                               'str_replace'
         17        SEND_VAL                                                 '%27'
         18        SEND_VAL                                                 '%C2%B4'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21        ASSIGN                                                   !0, $9
   31    22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 <array>
         24        SEND_VAL                                                 ''
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $11     
         27        ASSIGN                                                   !0, $11
   32    28        INIT_FCALL                                               'preg_quote'
         29        SEND_VAR                                                 !0
         30        SEND_VAL                                                 '%2F'
         31        DO_ICALL                                         $13     
         32        ASSIGN                                                   !0, $13
   33    33        INIT_FCALL                                               'explode'
         34        SEND_VAL                                                 '+'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $15     
         37        ASSIGN                                                   !1, $15
   36    38    >   INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                                 
   37    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
         44      > 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/eZ9kY
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:
168.17 ms | 1400 KiB | 23 Q