3v4l.org

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

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

End of function __tostring

End of class Derp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.08 ms | 1395 KiB | 17 Q