3v4l.org

run code in 300+ PHP versions simultaneously
<?php readonly class DTO { public function __construct( public readonly int $a, public readonly int $b, public readonly int $c, public readonly int $d, public readonly int $e, public readonly int $f, ) {} } $dto = new DTO(1, 2, 3, 4, 5, 6); var_dump($dto); $copy = new DTO(...(['d' => 42] + get_object_vars($dto))); var_dump($copy);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZWX5G
function name:  (null)
number of ops:  25
compiled vars:  !0 = $dto, !1 = $copy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'DTO'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              3
          4        SEND_VAL_EX                                              4
          5        SEND_VAL_EX                                              5
          6        SEND_VAL_EX                                              6
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $2
   15     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   17    12        NEW                                              $6      'DTO'
         13        INIT_FCALL                                               'get_object_vars'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        ADD                                              ~8      <array>, $7
         17        SEND_UNPACK                                              ~8
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      1          
         20        ASSIGN                                                   !1, $6
   18    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class DTO:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZWX5G
function name:  __construct
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
          6        ASSIGN_OBJ                                               'a'
          7        OP_DATA                                                  !0
          8        ASSIGN_OBJ                                               'b'
          9        OP_DATA                                                  !1
         10        ASSIGN_OBJ                                               'c'
         11        OP_DATA                                                  !2
         12        ASSIGN_OBJ                                               'd'
         13        OP_DATA                                                  !3
         14        ASSIGN_OBJ                                               'e'
         15        OP_DATA                                                  !4
         16        ASSIGN_OBJ                                               'f'
         17        OP_DATA                                                  !5
   11    18      > RETURN                                                   null

End of function __construct

End of class DTO.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.71 ms | 1016 KiB | 15 Q