3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function __toString() { return '-'; } } class B {public function __toString() { return '-'; } } class C {public function __toString() { return '-'; } } $c = new C; var_dump(array_unique([$c, new A, new B, $c, new A]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UGCvB
function name:  (null)
number of ops:  24
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'a'
    4     1        DECLARE_CLASS                                                'b'
    5     2        DECLARE_CLASS                                                'c'
    7     3        NEW                                                  $1      'C'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !0, $1
    9     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'array_unique'
          8        INIT_ARRAY                                           ~4      !0
          9        NEW                                                  $5      'A'
         10        DO_FCALL                                          0          
         11        ADD_ARRAY_ELEMENT                                    ~4      $5
         12        NEW                                                  $7      'B'
         13        DO_FCALL                                          0          
         14        ADD_ARRAY_ELEMENT                                    ~4      $7
         15        ADD_ARRAY_ELEMENT                                    ~4      !0
         16        NEW                                                  $9      'A'
         17        DO_FCALL                                          0          
         18        ADD_ARRAY_ELEMENT                                    ~4      $9
         19        SEND_VAL                                                     ~4
         20        DO_ICALL                                             $11     
         21        SEND_VAR                                                     $11
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Class A:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UGCvB
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                       '-'
          1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

End of class A.

Class B:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UGCvB
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                       '-'
          1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

End of class B.

Class C:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UGCvB
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                       '-'
          1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.52 ms | 1925 KiB | 15 Q