3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass(); $object->foo = 'bar'; $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/WKekr
function name:  (null)
number of ops:  18
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, 'bar'
          6        OP_DATA                                                  <array>
    7     7        INIT_FCALL                                               'json_encode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    9    11        ECHO                                                     'var+jsonString+%3D+'
         12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        ECHO                                                     $9
         16        ECHO                                                     '%3B'
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.59 ms | 1394 KiB | 15 Q