3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $a->id = 1; $b = $a; // mesmo objeto $c = new stdClass; $c->id = 2; $test = array($a, $b, $c); print_r(array_unique($test, SORT_REGULAR));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3O810
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    5     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  1
    7     5        ASSIGN                                                   !1, !0
    9     6        NEW                                              $9      'stdClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   11     9        ASSIGN_OBJ                                               !2, 'id'
         10        OP_DATA                                                  2
   14    11        INIT_ARRAY                                       ~13     !0
         12        ADD_ARRAY_ELEMENT                                ~13     !1
         13        ADD_ARRAY_ELEMENT                                ~13     !2
         14        ASSIGN                                                   !3, ~13
   16    15        INIT_FCALL                                               'print_r'
         16        INIT_FCALL                                               'array_unique'
         17        SEND_VAR                                                 !3
         18        SEND_VAL                                                 0
         19        DO_ICALL                                         $15     
         20        SEND_VAR                                                 $15
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.3 ms | 1437 KiB | 15 Q