3v4l.org

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

Class MyClass:
Function setprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gospa
function name:  setProp
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'prop'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setprop

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.06 ms | 1396 KiB | 17 Q