3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj1 = new StdClass(); $obj1->name = ‘Darth’; $obj2 = new StdClass(); $obj2->name = ‘Vader’; echo [$obj1, $obj2][0]->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7dQp0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $obj1, !1 = $obj2
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        FETCH_CONSTANT                                   ~6      '%E2%80%98Darth%E2%80%99'
          4        ASSIGN_OBJ                                               !0, 'name'
          5        OP_DATA                                                  ~6
    4     6        NEW                                              $7      'StdClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $7
    5     9        FETCH_CONSTANT                                   ~11     '%E2%80%98Vader%E2%80%99'
         10        ASSIGN_OBJ                                               !1, 'name'
         11        OP_DATA                                                  ~11
    6    12        INIT_ARRAY                                       ~12     !0
         13        ADD_ARRAY_ELEMENT                                ~12     !1
         14        FETCH_DIM_R                                      ~13     ~12, 0
         15        FETCH_OBJ_R                                      ~14     ~13, 'name'
         16        ECHO                                                     ~14
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.8 ms | 1384 KiB | 13 Q