3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validNumber($number) { $number = intval($number); return ($number == 1 || $number == 2 || $number == 3 || $number == 4); } $xss = '3 /><img src=x onerror="alert(1)"'; var_dump(validNumber($xss));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M0G3F
function name:  (null)
number of ops:  8
compiled vars:  !0 = $xss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '3+%2F%3E%3Cimg+src%3Dx+onerror%3D%22alert%281%29%22'
    9     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'validnumber'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function validnumber:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 10
Branch analysis from position: 7
filename:       /in/M0G3F
function name:  validNumber
number of ops:  15
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        CAST                                          4  ~1      !0
          2        ASSIGN                                                   !0, ~1
    4     3        IS_EQUAL                                         ~3      !0, 1
          4      > JMPNZ_EX                                         ~3      ~3, ->7
          5    >   IS_EQUAL                                         ~4      !0, 2
          6        BOOL                                             ~3      ~4
          7    > > JMPNZ_EX                                         ~3      ~3, ->10
          8    >   IS_EQUAL                                         ~5      !0, 3
          9        BOOL                                             ~3      ~5
         10    > > JMPNZ_EX                                         ~3      ~3, ->13
         11    >   IS_EQUAL                                         ~6      !0, 4
         12        BOOL                                             ~3      ~6
         13    > > RETURN                                                   ~3
    5    14*     > RETURN                                                   null

End of function validnumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.77 ms | 1403 KiB | 16 Q