3v4l.org

run code in 300+ PHP versions simultaneously
<?php // // What ENT_* should I use for htmlspecialchars? // $text = '&"\'<> '; // This is insecure! echo "DEFAULT: " . htmlspecialchars($text, ENT_HTML401 | ENT_COMPAT, 'UTF-8') . "\n"; // This is insecure! echo "ENT_HTML5: " . htmlspecialchars($text, ENT_HTML5, 'UTF-8') . "\n"; // This is good echo "ENT_QUOTES: " . htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PvRtm
function name:  (null)
number of ops:  26
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%26%22%27%3C%3E+'
    8     1        INIT_FCALL                                               'htmlspecialchars'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        SEND_VAL                                                 'UTF-8'
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      'DEFAULT%3A++++', $2
          7        CONCAT                                           ~4      ~3, '%0A'
          8        ECHO                                                     ~4
   11     9        INIT_FCALL                                               'htmlspecialchars'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 48
         12        SEND_VAL                                                 'UTF-8'
         13        DO_ICALL                                         $5      
         14        CONCAT                                           ~6      'ENT_HTML5%3A++', $5
         15        CONCAT                                           ~7      ~6, '%0A'
         16        ECHO                                                     ~7
   14    17        INIT_FCALL                                               'htmlspecialchars'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 11
         20        SEND_VAL                                                 'UTF-8'
         21        DO_ICALL                                         $8      
         22        CONCAT                                           ~9      'ENT_QUOTES%3A+', $8
         23        CONCAT                                           ~10     ~9, '%0A'
         24        ECHO                                                     ~10
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.91 ms | 1451 KiB | 14 Q