3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 ?>
based on qK5d4
Output for 7.2.0
Warning: Use of undefined constant toto - assumed 'toto' (this will throw an Error in a future version of PHP) in /in/Gl1mS on line 22 Warning: Use of undefined constant toto - assumed 'toto' (this will throw an Error in a future version of PHP) in /in/Gl1mS on line 22
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant toto - assumed 'toto' in /in/Gl1mS on line 22 Notice: Use of undefined constant toto - assumed 'toto' in /in/Gl1mS on line 22
Output for 5.3.18 - 5.6.28
Notice: Use of undefined constant toto - assumed 'toto' in /in/Gl1mS on line 22 Notice: Use of undefined constant toto - assumed 'toto' in /in/Gl1mS on line 23