3v4l.org

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

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.19 ms | 1395 KiB | 17 Q