3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('foo' => 'bar'); $obj = new stdClass(); $obj->foo = 'bar'; print json_encode($arr); print json_encode($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kZds9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        NEW                                              $3      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
    4     4        ASSIGN_OBJ                                               !1, 'foo'
          5        OP_DATA                                                  'bar'
    6     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9        ECHO                                                     $7
    7    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ECHO                                                     $8
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.27 ms | 1394 KiB | 15 Q