3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected self $coo; } $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/q6978
function name:  (null)
number of ops:  16
compiled vars:  !0 = $rc, !1 = $rpp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    9     4        INIT_METHOD_CALL                                         !0, 'getProperty'
          5        SEND_VAL_EX                                              'coo'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   11     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !1, 'getType'
         10        DO_FCALL                                      0  $7      
         11        INIT_METHOD_CALL                                         $7, 'getName'
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.55 ms | 1398 KiB | 15 Q