3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop; } $foo = new MyClass(); $foo->prop = 'test1'; $bar = $foo; $bam = new MyClass(); $bam->prop = 'test2'; $bart = new MyClass(); $bart -> prop = 'test1'; $test = array($foo, $bart, $bar, $bam); 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/86fl4
function name:  (null)
number of ops:  29
compiled vars:  !0 = $foo, !1 = $bar, !2 = $bam, !3 = $bart, !4 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $5      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    8     3        ASSIGN_OBJ                                               !0, 'prop'
          4        OP_DATA                                                  'test1'
   10     5        ASSIGN                                                   !1, !0
   12     6        NEW                                              $10     'MyClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
   13     9        ASSIGN_OBJ                                               !2, 'prop'
         10        OP_DATA                                                  'test2'
   14    11        NEW                                              $14     'MyClass'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !3, $14
   15    14        ASSIGN_OBJ                                               !3, 'prop'
         15        OP_DATA                                                  'test1'
   16    16        INIT_ARRAY                                       ~18     !0
         17        ADD_ARRAY_ELEMENT                                ~18     !3
         18        ADD_ARRAY_ELEMENT                                ~18     !1
         19        ADD_ARRAY_ELEMENT                                ~18     !2
         20        ASSIGN                                                   !4, ~18
   18    21        INIT_FCALL                                               'print_r'
         22        INIT_FCALL                                               'array_unique'
         23        SEND_VAR                                                 !4
         24        SEND_VAL                                                 0
         25        DO_ICALL                                         $20     
         26        SEND_VAR                                                 $20
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.19 ms | 1387 KiB | 17 Q