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; } public function __toString() { return spl_object_hash($this); } } $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/QqCeN
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $someObject, !2 = $someOtherObject, !3 = $arrFiltered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'someclass'
   21     1        ASSIGN                                                   !0, <array>
   22     2        NEW                                              $5      'SomeClass'
          3        SEND_VAL_EX                                              3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   23     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  !1
   24     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  !1
   25    10        NEW                                              $10     'SomeClass'
         11        SEND_VAL_EX                                              4
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $10
   26    14        ASSIGN_DIM                                               !0
         15        OP_DATA                                                  !2
   27    16        ASSIGN_DIM                                               !0
         17        OP_DATA                                                  !2
   29    18        INIT_FCALL                                               'array_unique'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $15     
         21        ASSIGN                                                   !3, $15
   30    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class SomeClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqCeN
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/QqCeN
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

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqCeN
function name:  __toString
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'spl_object_hash'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   18     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.58 ms | 1392 KiB | 19 Q