3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o = new stdClass; $o->name = "John"; $o->age = 30; $o->car =null; $o2 = new stdClass; $o2->name = "Mike"; $o2->age = 32; $o2->car =null; $myarray = [$o, $o2]; var_dump(json_encode($myarray));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Fcn5
function name:  (null)
number of ops:  28
compiled vars:  !0 = $o, !1 = $o2, !2 = $myarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'John'
    6     5        ASSIGN_OBJ                                               !0, 'age'
          6        OP_DATA                                                  30
    7     7        ASSIGN_OBJ                                               !0, 'car'
          8        OP_DATA                                                  null
    9     9        NEW                                              $9      'stdClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $9
   10    12        ASSIGN_OBJ                                               !1, 'name'
         13        OP_DATA                                                  'Mike'
   11    14        ASSIGN_OBJ                                               !1, 'age'
         15        OP_DATA                                                  32
   12    16        ASSIGN_OBJ                                               !1, 'car'
         17        OP_DATA                                                  null
   14    18        INIT_ARRAY                                       ~15     !0
         19        ADD_ARRAY_ELEMENT                                ~15     !1
         20        ASSIGN                                                   !2, ~15
   16    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'json_encode'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $17     
         25        SEND_VAR                                                 $17
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.67 ms | 1006 KiB | 15 Q