3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $var = true; } class Bar extends Foo { public $var = 'abc'; } $reflectionFoo = new ReflectionProperty('Foo', 'var'); $reflectionBar = new ReflectionProperty('Bar', 'var'); $bar = new Bar(); var_dump((new ReflectionClass('Bar'))->getProperties());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nn3vQ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $reflectionFoo, !1 = $reflectionBar, !2 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'ReflectionProperty'
          1        SEND_VAL_EX                                              'Foo'
          2        SEND_VAL_EX                                              'var'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   15     5        NEW                                              $6      'ReflectionProperty'
          6        SEND_VAL_EX                                              'Bar'
          7        SEND_VAL_EX                                              'var'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   18    10        NEW                                              $9      'Bar'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $9
   20    13        INIT_FCALL                                               'var_dump'
         14        NEW                                              $12     'ReflectionClass'
         15        SEND_VAL_EX                                              'Bar'
         16        DO_FCALL                                      0          
         17        INIT_METHOD_CALL                                         $12, 'getProperties'
         18        DO_FCALL                                      0  $14     
         19        SEND_VAR                                                 $14
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1395 KiB | 15 Q