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, protected ?D $unused = NULL, ) { if ($this->c instanceof B) { trigger_error('A, B, C, D is deprecated, pass A, C, D instead', E_USER_DEPRECATED); $this->c = $d; $this->d = $unused; } 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/08cBi
function name:  (null)
number of ops:  28
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     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
   27    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 = 15, Position 2 = 23
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/08cBi
function name:  __construct
number of ops:  36
compiled vars:  !0 = $a, !1 = $c, !2 = $d, !3 = $unused
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
          4        ASSIGN_OBJ                                               'a'
          5        OP_DATA                                                  !0
          6        ASSIGN_OBJ                                               'c'
          7        OP_DATA                                                  !1
          8        ASSIGN_OBJ                                               'd'
          9        OP_DATA                                                  !2
         10        ASSIGN_OBJ                                               'unused'
         11        OP_DATA                                                  !3
   15    12        FETCH_OBJ_R                                      ~4      'c'
         13        INSTANCEOF                                               ~4, 'B'
         14      > JMPZ                                                     ~5, ->23
   16    15    >   INIT_FCALL                                               'trigger_error'
         16        SEND_VAL                                                 'A%2C+B%2C+C%2C+D+is+deprecated%2C+pass+A%2C+C%2C+D+instead'
         17        SEND_VAL                                                 16384
         18        DO_ICALL                                                 
   17    19        ASSIGN_OBJ                                               'c'
         20        OP_DATA                                                  !2
   18    21        ASSIGN_OBJ                                               'd'
         22        OP_DATA                                                  !3
   20    23    >   INIT_FCALL                                               'var_dump'
         24        FETCH_OBJ_R                                      ~9      'a'
         25        SEND_VAL                                                 ~9
         26        DO_ICALL                                                 
   21    27        INIT_FCALL                                               'var_dump'
         28        FETCH_OBJ_R                                      ~11     'c'
         29        SEND_VAL                                                 ~11
         30        DO_ICALL                                                 
   22    31        INIT_FCALL                                               'var_dump'
         32        FETCH_OBJ_R                                      ~13     'd'
         33        SEND_VAL                                                 ~13
         34        DO_ICALL                                                 
   23    35      > RETURN                                                   null

End of function __construct

End of class Z.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
123.19 ms | 1442 KiB | 15 Q