3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass { public $prop; } $foo = new MyClass(); $foo->prop = 'test1'; $bar = $foo; $bam = new MyClass(); $bam->prop = 'test2'; $test = array($foo, $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/WhOcl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $foo, !1 = $bar, !2 = $bam, !3 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $4      'MyClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $4
    8     3        ASSIGN_OBJ                                                   !0, 'prop'
          4        OP_DATA                                                      'test1'
   10     5        ASSIGN                                                       !1, !0
   12     6        NEW                                                  $9      'MyClass'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $9
   13     9        ASSIGN_OBJ                                                   !2, 'prop'
         10        OP_DATA                                                      'test2'
   15    11        INIT_ARRAY                                           ~13     !0
         12        ADD_ARRAY_ELEMENT                                    ~13     !1
         13        ADD_ARRAY_ELEMENT                                    ~13     !2
         14        ASSIGN                                                       !3, ~13
   17    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

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.7 ms | 3110 KiB | 15 Q