3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Position { private $productId; private $count; private $createdAt; public function __construct(int $productId, int $count = 1) { $this->count = $count; $this->createdAt = new DateTimeImmutable('now'); } } $position = new Position(1); $secondPosition = new Position(1); var_dump($position == $secondPosition);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mp2Hr
function name:  (null)
number of ops:  13
compiled vars:  !0 = $position, !1 = $secondPosition
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $2      'Position'
          1        SEND_VAL_EX                                                  1
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   15     4        NEW                                                  $5      'Position'
          5        SEND_VAL_EX                                                  1
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $5
   17     8        INIT_FCALL                                                   'var_dump'
          9        IS_EQUAL                                             ~8      !0, !1
         10        SEND_VAL                                                     ~8
         11        DO_ICALL                                                     
         12      > RETURN                                                       1

Class Position:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mp2Hr
function name:  __construct
number of ops:  10
compiled vars:  !0 = $productId, !1 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      1
    9     2        ASSIGN_OBJ                                                   'count'
          3        OP_DATA                                                      !1
   10     4        NEW                                                  $4      'DateTimeImmutable'
          5        SEND_VAL_EX                                                  'now'
          6        DO_FCALL                                          0          
          7        ASSIGN_OBJ                                                   'createdAt'
          8        OP_DATA                                                      $4
   11     9      > RETURN                                                       null

End of function __construct

End of class Position.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.89 ms | 2084 KiB | 14 Q