3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} class C {} class D {} class Z { public function __construct( protected A $a, protected C|B $c, protected D|C $d, ) { if ($this->c instanceof B) { trigger_error('A, B, C, D is deprecated, pass A, C, D instead', E_USER_DEPRECATED); $this->c = $this->d; $this->d = func_get_arg(3); } var_dump($this->a); var_dump($this->c); var_dump($this->d); } } new Z(new A(), new B(), new C(), new D()); new Z(new A(), new C(), new D());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WVIp1
function name:  (null)
number of ops:  28
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $0      'Z'
          1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $1
          4        NEW                                              $3      'B'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $3
          7        NEW                                              $5      'C'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $5
         10        NEW                                              $7      'D'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $7
         13        DO_FCALL                                      0          
         14        FREE                                                     $0
   26    15        NEW                                              $10     'Z'
         16        NEW                                              $11     'A'
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $11
         19        NEW                                              $13     'C'
         20        DO_FCALL                                      0          
         21        SEND_VAR_NO_REF_EX                                       $13
         22        NEW                                              $15     'D'
         23        DO_FCALL                                      0          
         24        SEND_VAR_NO_REF_EX                                       $15
         25        DO_FCALL                                      0          
         26        FREE                                                     $10
         27      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class D: [no user functions]
Class Z:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/WVIp1
function name:  __construct
number of ops:  37
compiled vars:  !0 = $a, !1 = $c, !2 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        ASSIGN_OBJ                                               'a'
          4        OP_DATA                                                  !0
          5        ASSIGN_OBJ                                               'c'
          6        OP_DATA                                                  !1
          7        ASSIGN_OBJ                                               'd'
          8        OP_DATA                                                  !2
   14     9        FETCH_OBJ_R                                      ~3      'c'
         10        INSTANCEOF                                               ~3, 'B'
         11      > JMPZ                                                     ~4, ->24
   15    12    >   INIT_FCALL                                               'trigger_error'
         13        SEND_VAL                                                 'A%2C+B%2C+C%2C+D+is+deprecated%2C+pass+A%2C+C%2C+D+instead'
         14        SEND_VAL                                                 16384
         15        DO_ICALL                                                 
   16    16        FETCH_OBJ_R                                      ~7      'd'
         17        ASSIGN_OBJ                                               'c'
         18        OP_DATA                                                  ~7
   17    19        INIT_FCALL                                               'func_get_arg'
         20        SEND_VAL                                                 3
         21        DO_ICALL                                         $9      
         22        ASSIGN_OBJ                                               'd'
         23        OP_DATA                                                  $9
   19    24    >   INIT_FCALL                                               'var_dump'
         25        FETCH_OBJ_R                                      ~10     'a'
         26        SEND_VAL                                                 ~10
         27        DO_ICALL                                                 
   20    28        INIT_FCALL                                               'var_dump'
         29        FETCH_OBJ_R                                      ~12     'c'
         30        SEND_VAL                                                 ~12
         31        DO_ICALL                                                 
   21    32        INIT_FCALL                                               'var_dump'
         33        FETCH_OBJ_R                                      ~14     'd'
         34        SEND_VAL                                                 ~14
         35        DO_ICALL                                                 
   22    36      > RETURN                                                   null

End of function __construct

End of class Z.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.82 ms | 1466 KiB | 16 Q