3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ComplicatedConstructor { public function __construct( public readonly int $integer, public readonly float $float, public readonly bool $boolean, public readonly string $string, private ?\Closure $closure = null, public readonly float|string|null $optional = 'optional', ) {} } $outOfOrderArray = [ 'optional' => 'The optional', 'string' => 'The string', 'float' => (float) '42.5', 'integer' => 9001, 'boolean' => !true, ]; var_dump(new ComplicatedConstructor(...$outOfOrderArray));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lfWrQ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $outOfOrderArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                       !0, <array>
   23     1        INIT_FCALL                                                   'var_dump'
          2        NEW                                                  $2      'ComplicatedConstructor'
          3        SEND_UNPACK                                                  !0
          4        CHECK_UNDEF_ARGS                                             
          5        DO_FCALL                                          1          
          6        SEND_VAR                                                     $2
          7        DO_ICALL                                                     
          8      > RETURN                                                       1

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

End of function __construct

End of class ComplicatedConstructor.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.64 ms | 1153 KiB | 15 Q