3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FanStruct{ public $date; public $userid; function __construct($date, $id){ $this->date = $date; $this->userid = $id; } public function __toString() { return $this->date . $this->userid; } } $test = array( new FanStruct( 'today', 1 ) ,new FanStruct( 'today', 1 ) ,new FanStruct( 'tomorrow', 1 ) ); print_r( array_unique( $test ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SENOW
function name:  (null)
number of ops:  24
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'fanstruct'
   19     1        NEW                                              $1      'FanStruct'
          2        SEND_VAL_EX                                              'today'
          3        SEND_VAL_EX                                              1
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~3      $1
   20     6        NEW                                              $4      'FanStruct'
          7        SEND_VAL_EX                                              'today'
          8        SEND_VAL_EX                                              1
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~3      $4
   21    11        NEW                                              $6      'FanStruct'
         12        SEND_VAL_EX                                              'tomorrow'
         13        SEND_VAL_EX                                              1
         14        DO_FCALL                                      0          
         15        ADD_ARRAY_ELEMENT                                ~3      $6
   18    16        ASSIGN                                                   !0, ~3
   24    17        INIT_FCALL                                               'print_r'
         18        INIT_FCALL                                               'array_unique'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SENOW
function name:  __toString
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'date'
          1        FETCH_OBJ_R                                      ~1      'userid'
          2        CONCAT                                           ~2      ~0, ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   15     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function __tostring

End of class FanStruct.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.33 ms | 1392 KiB | 17 Q