3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['tval'] = "hey what's up"; if(isset($_POST['tval'])) { $text = explode(PHP_EOL, htmlspecialchars($_POST['tval'])); foreach($text as $line) { echo "<script>alert('". $line ."');</script>"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 23
filename:       /in/hkefn
function name:  (null)
number of ops:  24
compiled vars:  !0 = $text, !1 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $2      '_POST'
          1        ASSIGN_DIM                                               $2, 'tval'
          2        OP_DATA                                                  'hey%0Awhat%27s+up'
    6     3        FETCH_IS                                         ~4      '_POST'
          4        ISSET_ISEMPTY_DIM_OBJ                         0          ~4, 'tval'
          5      > JMPZ                                                     ~5, ->23
    7     6    >   INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%0A'
          8        INIT_FCALL                                               'htmlspecialchars'
          9        FETCH_R                      global              ~6      '_POST'
         10        FETCH_DIM_R                                      ~7      ~6, 'tval'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !0, $9
    8    16      > FE_RESET_R                                       $11     !0, ->22
         17    > > FE_FETCH_R                                               $11, !1, ->22
    9    18    >   CONCAT                                           ~12     '%3Cscript%3Ealert%28%27', !1
         19        CONCAT                                           ~13     ~12, '%27%29%3B%3C%2Fscript%3E'
         20        ECHO                                                     ~13
    8    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $11
   11    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.05 ms | 1011 KiB | 15 Q