3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeHTML($var) { return htmlentities($var); } $link = "http://toto.com/%3C%2Fa%3E%3Ca%20href%3Djavascript%3Aalert(1)%3B"; if (!is_null($link)) { if (!filter_var($link, FILTER_VALIDATE_URL)) printf("ERROR !"); } if (is_null($link)) { $link = 'http://'; printf("NULL !"); } toto.safeHTML($link).toto ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 13
Branch analysis from position: 13
filename:       /in/Gl1mS
function name:  (null)
number of ops:  28
compiled vars:  !0 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Ftoto.com%2F%253C%252Fa%253E%253Ca%2520href%253Djavascript%253Aalert%281%29%253B'
   10     1        TYPE_CHECK                                    2  ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->13
   12     4    >   INIT_FCALL                                               'filter_var'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 273
          7        DO_ICALL                                         $4      
          8        BOOL_NOT                                         ~5      $4
          9      > JMPZ                                                     ~5, ->13
   13    10    >   INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 'ERROR+%21'
         12        DO_ICALL                                                 
   16    13    >   TYPE_CHECK                                    2          !0
         14      > JMPZ                                                     ~7, ->19
   18    15    >   ASSIGN                                                   !0, 'http%3A%2F%2F'
   19    16        INIT_FCALL                                               'printf'
         17        SEND_VAL                                                 'NULL+%21'
         18        DO_ICALL                                                 
   22    19    >   FETCH_CONSTANT                                   ~10     'toto'
         20        INIT_FCALL                                               'safehtml'
         21        SEND_VAR                                                 !0
         22        DO_FCALL                                      0  $11     
         23        CONCAT                                           ~12     ~10, $11
         24        FETCH_CONSTANT                                   ~13     'toto'
         25        CONCAT                                           ~14     ~12, ~13
         26        FREE                                                     ~14
   23    27      > RETURN                                                   1

Function safehtml:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gl1mS
function name:  safeHTML
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    6     5*     > RETURN                                                   null

End of function safehtml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.37 ms | 1403 KiB | 20 Q