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 ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Undefined constant "toto" in /in/Gl1mS:22 Stack trace: #0 {main} thrown in /in/Gl1mS on line 22
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.0.33, 7.1.0 - 7.1.33
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.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
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

preferences:
271.01 ms | 402 KiB | 364 Q