3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Boo { protected self $coo; } class Foo { use Boo; } $rc = new ReflectionClass(Foo::class); $rpp = $rc->getProperty('coo'); var_dump($rpp->getType()->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YDJnU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $rc, !1 = $rpp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'foo'
   13     1        NEW                                              $2      'ReflectionClass'
          2        SEND_VAL_EX                                              'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   14     5        INIT_METHOD_CALL                                         !0, 'getProperty'
          6        SEND_VAL_EX                                              'coo'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   16     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !1, 'getType'
         11        DO_FCALL                                      0  $7      
         12        INIT_METHOD_CALL                                         $7, 'getName'
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Boo: [no user functions]
Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.9 ms | 1399 KiB | 15 Q