3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<INPUT bar&quot;; alert(&quot;Meow!&quot;); var xss=&quot;true INPUT; $array = array('input' => $input); $output = json_encode($array, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?> <head> <script type="text/javascript"> var array = <?php echo $output; ?>; </script> </head>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/brSil
function name:  (null)
number of ops:  12
compiled vars:  !0 = $input, !1 = $array, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'bar%26quot%3B%3B+alert%28%26quot%3BMeow%21%26quot%3B%29%3B+var+xss%3D%26quot%3Btrue'
    6     1        INIT_ARRAY                                       ~4      !0, 'input'
          2        ASSIGN                                                   !1, ~4
    7     3        INIT_FCALL                                               'json_encode'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 15
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   10     8        ECHO                                                     '%3Chead%3E%0A++++%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++++++var+array+%3D+'
   12     9        ECHO                                                     !2
         10        ECHO                                                     '%3B%0A++++%3C%2Fscript%3E%0A%3C%2Fhead%3E'
   14    11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.61 ms | 1394 KiB | 15 Q