3v4l.org

run code in 500+ PHP versions simultaneously
<?php function GET($name = NULL, $value = false) { $content = (!empty($_GET[$name]) ? trim($_GET[$name]) : (!empty($value) && !is_array($value) ? trim($value) : false)); if (is_numeric($content)) return preg_replace("@([^0-9])@Ui", "", $content); else if (is_bool($content)) return ($content ? true : false); else if (is_float($content)) return preg_replace('@([^0-9\,\.\+\-])@Ui', "", $content); else if (is_string($content)) { if (filter_var($content, FILTER_VALIDATE_URL)) return $content; else if (filter_var($content, FILTER_VALIDATE_EMAIL)) return $content; else if (filter_var($content, FILTER_VALIDATE_IP)) return $content; else if (filter_var($content, FILTER_VALIDATE_FLOAT)) return $content; else return preg_replace('@(\p{C})@ui', "", $content); } else false; } $_GET['foo'] = 'Detta är en annons'; $_GET['bar'] = '2^8'; var_dump(GET('foo')); var_dump(GET('bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmDiL
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   FETCH_W                          global              $0      '_GET'
          1        ASSIGN_DIM                                                   $0, 'foo'
          2        OP_DATA                                                      'Detta+%C3%A4r+en+annons'
   27     3        FETCH_W                          global              $2      '_GET'
          4        ASSIGN_DIM                                                   $2, 'bar'
          5        OP_DATA                                                      '2%5E8'
   28     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'get'
          8        SEND_VAL                                                     'foo'
          9        DO_FCALL                                          0  $4      
         10        SEND_VAR                                                     $4
         11        DO_ICALL                                                     
   29    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL                                                   'get'
         14        SEND_VAL                                                     'bar'
         15        DO_FCALL                                          0  $6      
         16        SEND_VAR                                                     $6
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 44
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 78
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
Branch analysis from position: 30
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
Branch analysis from position: 30
Branch analysis from position: 17
filename:       /in/YmDiL
function name:  GET
number of ops:  79
compiled vars:  !0 = $name, !1 = $value, !2 = $content
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                            !0      null
          1        RECV_INIT                                            !1      <false>
    5     2        FETCH_IS                                             ~3      '_GET'
          3        ISSET_ISEMPTY_DIM_OBJ                             1  ~4      ~3, !0
          4        BOOL_NOT                                             ~5      ~4
          5      > JMPZ                                                         ~5, ->11
          6    >   FETCH_R                          global              ~6      '_GET'
          7        FETCH_DIM_R                                          ~7      ~6, !0
          8        FRAMELESS_ICALL_1                trim                ~8      ~7
          9        QM_ASSIGN                                            ~9      ~8
         10      > JMP                                                          ->23
         11    >   ISSET_ISEMPTY_CV                                     ~10     !1
         12        BOOL_NOT                                             ~11     ~10
         13      > JMPZ_EX                                              ~11     ~11, ->17
         14    >   TYPE_CHECK                                      128  ~12     !1
         15        BOOL_NOT                                             ~13     ~12
         16        BOOL                                                 ~11     ~13
         17    > > JMPZ                                                         ~11, ->21
         18    >   FRAMELESS_ICALL_1                trim                ~14     !1
         19        QM_ASSIGN                                            ~15     ~14
         20      > JMP                                                          ->22
         21    >   QM_ASSIGN                                            ~15     <false>
         22    >   QM_ASSIGN                                            ~9      ~15
         23    >   ASSIGN                                                       !2, ~9
    6    24        FRAMELESS_ICALL_1                is_numeric          ~17     !2
         25      > JMPZ                                                         ~17, ->30
    7    26    >   FRAMELESS_ICALL_3                preg_replace        ~18     '%40%28%5B%5E0-9%5D%29%40Ui', ''
         27        OP_DATA                                                      !2
         28      > RETURN                                                       ~18
    6    29*       JMP                                                          ->78
    8    30    >   TYPE_CHECK                                       12          !2
         31      > JMPZ                                                         ~19, ->38
    9    32    > > JMPZ                                                         !2, ->35
         33    >   QM_ASSIGN                                            ~20     <true>
         34      > JMP                                                          ->36
         35    >   QM_ASSIGN                                            ~20     <false>
         36    > > RETURN                                                       ~20
    8    37*       JMP                                                          ->78
   10    38    >   TYPE_CHECK                                       32          !2
         39      > JMPZ                                                         ~21, ->44
   11    40    >   FRAMELESS_ICALL_3                preg_replace        ~22     '%40%28%5B%5E0-9%5C%2C%5C.%5C%2B%5C-%5D%29%40Ui', ''
         41        OP_DATA                                                      !2
         42      > RETURN                                                       ~22
   10    43*       JMP                                                          ->78
   12    44    >   TYPE_CHECK                                       64          !2
         45      > JMPZ                                                         ~23, ->78
   13    46    >   INIT_FCALL                                                   'filter_var'
         47        SEND_VAR                                                     !2
         48        SEND_VAL                                                     273
         49        DO_ICALL                                             $24     
         50      > JMPZ                                                         $24, ->53
   14    51    > > RETURN                                                       !2
   13    52*       JMP                                                          ->77
   15    53    >   INIT_FCALL                                                   'filter_var'
         54        SEND_VAR                                                     !2
         55        SEND_VAL                                                     274
         56        DO_ICALL                                             $25     
         57      > JMPZ                                                         $25, ->60
   16    58    > > RETURN                                                       !2
   15    59*       JMP                                                          ->77
   17    60    >   INIT_FCALL                                                   'filter_var'
         61        SEND_VAR                                                     !2
         62        SEND_VAL                                                     275
         63        DO_ICALL                                             $26     
         64      > JMPZ                                                         $26, ->67
   18    65    > > RETURN                                                       !2
   17    66*       JMP                                                          ->77
   19    67    >   INIT_FCALL                                                   'filter_var'
         68        SEND_VAR                                                     !2
         69        SEND_VAL                                                     259
         70        DO_ICALL                                             $27     
         71      > JMPZ                                                         $27, ->74
   20    72    > > RETURN                                                       !2
   19    73*       JMP                                                          ->77
   22    74    >   FRAMELESS_ICALL_3                preg_replace        ~28     '%40%28%5Cp%7BC%7D%29%40ui', ''
         75        OP_DATA                                                      !2
         76      > RETURN                                                       ~28
   12    77*       JMP                                                          ->78
   24    78    > > RETURN                                                       null

End of function get

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.71 ms | 3316 KiB | 22 Q