3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo{public $id;} $foo1 = new foo(); $foo1->id = 1; $foo2 = new foo(); $foo2->id = 2; $array = [$foo1, $foo2]; print_r($array->id);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/27ct0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo1, !1 = $foo2, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  1
    5     5        NEW                                              $7      'foo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    6     8        ASSIGN_OBJ                                               !1, 'id'
          9        OP_DATA                                                  2
    7    10        INIT_ARRAY                                       ~11     !0
         11        ADD_ARRAY_ELEMENT                                ~11     !1
         12        ASSIGN                                                   !2, ~11
    8    13        INIT_FCALL                                               'print_r'
         14        FETCH_OBJ_R                                      ~13     !2, 'id'
         15        SEND_VAL                                                 ~13
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1394 KiB | 15 Q