3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass; $object->color = 'lavender'; $object->size = 25; $array = json_decode(json_encode($object), TRUE); var_dump($array == (array) $object);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7kbsI
function name:  (null)
number of ops:  21
compiled vars:  !0 = $object, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        ASSIGN_OBJ                                               !0, 'color'
          4        OP_DATA                                                  'lavender'
    4     5        ASSIGN_OBJ                                               !0, 'size'
          6        OP_DATA                                                  25
    5     7        INIT_FCALL                                               'json_decode'
          8        INIT_FCALL                                               'json_encode'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    7    15        INIT_FCALL                                               'var_dump'
         16        CAST                                          7  ~10     !0
         17        IS_EQUAL                                         ~11     !1, ~10
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.95 ms | 1395 KiB | 19 Q