3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { protected $someProperty; public function __construct($prop) { $this->someProperty = $prop; } public function getSomeProperty() { return $this->someProperty; } } $arr = array(); $someObject = new SomeClass(3); $arr[] = $someObject; $arr[] = $someObject; $someOtherObject = new SomeClass(4); $arr[] = $someOtherObject; $arr[] = $someOtherObject; $arrFiltered = array_unique($arr); var_dump($arrFiltered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F1BEs
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $someObject, !2 = $someOtherObject, !3 = $arrFiltered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <array>
   17     1        NEW                                              $5      'SomeClass'
          2        SEND_VAL_EX                                              3
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   18     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  !1
   19     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  !1
   20     9        NEW                                              $10     'SomeClass'
         10        SEND_VAL_EX                                              4
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $10
   21    13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  !2
   22    15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  !2
   24    17        INIT_FCALL                                               'array_unique'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !3, $15
   25    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

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

End of function __construct

Function getsomeproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F1BEs
function name:  getSomeProperty
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'someProperty'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function getsomeproperty

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.97 ms | 1396 KiB | 17 Q