3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass(); $object->foo = 'bar'; $object->baz = "qux'qux"; $object->bar = [21, 42]; $json = json_encode($object); echo "var jsonString = ", json_encode($json), ';';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tEgBO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $object, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        ASSIGN_OBJ                                               !0, 'foo'
          4        OP_DATA                                                  'bar'
    5     5        ASSIGN_OBJ                                               !0, 'baz'
          6        OP_DATA                                                  'qux%27qux'
    6     7        ASSIGN_OBJ                                               !0, 'bar'
          8        OP_DATA                                                  <array>
    8     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !1, $8
   10    13        ECHO                                                     'var+jsonString+%3D+'
         14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $10     
         17        ECHO                                                     $10
         18        ECHO                                                     '%3B'
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.67 ms | 940 KiB | 16 Q