3v4l.org

run code in 300+ PHP versions simultaneously
<?php $titlex = 'this is a string with a \' in it'; $desc = 'this also is a string with a \' in it'; ?> <script> const updatepopup = (title, desc) => alert(title + '\n' + desc); </script> <h1>Test page</h1> <a href="" onclick="<?= htmlentities('updatepopup('.json_encode($titlex).', ' .json_encode($desc) .');', ENT_QUOTES); ?>">Click me</a>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IBVjC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $titlex, !1 = $desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'this+is+a+string+with+a+%27+in+it'
    3     1        ASSIGN                                                   !1, 'this+also+is+a+string+with+a+%27+in+it'
    5     2        ECHO                                                     '%3Cscript%3E%0A++++const+updatepopup+%3D+%28title%2C+desc%29+%3D%3E+alert%28title+%2B+%27%5Cn%27+%2B+desc%29%3B%0A%3C%2Fscript%3E%0A%3Ch1%3ETest+page%3C%2Fh1%3E%0A%3Ca+href%3D%22%22+onclick%3D%22'
    9     3        INIT_FCALL                                               'htmlentities'
          4        INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      'updatepopup%28', $4
          8        CONCAT                                           ~6      ~5, '%2C+'
          9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        CONCAT                                           ~8      ~6, $7
         13        CONCAT                                           ~9      ~8, '%29%3B'
         14        SEND_VAL                                                 ~9
         15        SEND_VAL                                                 3
         16        DO_ICALL                                         $10     
         17        ECHO                                                     $10
         18        ECHO                                                     '%22%3EClick+me%3C%2Fa%3E'
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.02 ms | 942 KiB | 18 Q