3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.99 ms | 1394 KiB | 15 Q