3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public A|(X&Y) $v; } class C { use A; } $prop = new \ReflectionProperty(C::class, 'v'); $union = $prop->getType(); $types = $union->getTypes(); $intersection = $types[1]; $types = $intersection->getTypes(); var_dump($types);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uGTg3
function name:  (null)
number of ops:  21
compiled vars:  !0 = $prop, !1 = $union, !2 = $types, !3 = $intersection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'c'
   12     1        NEW                                              $4      'ReflectionProperty'
          2        SEND_VAL_EX                                              'C'
          3        SEND_VAL_EX                                              'v'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   13     6        INIT_METHOD_CALL                                         !0, 'getType'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   14     9        INIT_METHOD_CALL                                         !1, 'getTypes'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
   15    12        FETCH_DIM_R                                      ~11     !2, 1
         13        ASSIGN                                                   !3, ~11
   16    14        INIT_METHOD_CALL                                         !3, 'getTypes'
         15        DO_FCALL                                      0  $13     
         16        ASSIGN                                                   !2, $13
   17    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class A: [no user functions]
Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.05 ms | 1001 KiB | 14 Q