3v4l.org

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

End of function __construct

End of class Z.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.44 ms | 1803 KiB | 15 Q