3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Something { public function __construct(protected string $a, public int $b) { var_dump(debug_backtrace(limit: 1)); var_dump(func_get_args()); } } $s_ordered = new Something('yo', 1337); var_dump($s_ordered); print "---------------\n"; $s_named = new Something(b: 1337, a: 'yo'); var_dump($s_named);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/17UTb
function name:  (null)
number of ops:  19
compiled vars:  !0 = $s_ordered, !1 = $s_named
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Something'
          1        SEND_VAL_EX                                              'yo'
          2        SEND_VAL_EX                                              1337
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   11     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   13     8        ECHO                                                     '---------------%0A'
   15     9        NEW                                              $6      'Something'
         10        SEND_VAL_EX                                              1337, 'b'
         11        SEND_VAL_EX                                              'yo', 'a'
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      1          
         14        ASSIGN                                                   !1, $6
   16    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function __construct

End of class Something.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.87 ms | 1461 KiB | 15 Q