3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = ['a','b','c']; $json = json_encode($ar); echo " <script> var x = $json ; </script>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4WEOD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $ar, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    6     5        ROPE_INIT                                     3  ~6      '%0A%3Cscript%3E%0Avar+x+%3D++'
    8     6        ROPE_ADD                                      1  ~6      ~6, !1
          7        ROPE_END                                      2  ~5      ~6, '+%3B++%0A%3C%2Fscript%3E'
          8        ECHO                                                     ~5
    9     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.86 ms | 1393 KiB | 15 Q