3v4l.org

run code in 300+ PHP versions simultaneously
<?php class P { private $v = 1; } class C extends P { private $v = 2; } $c = new C; $reflection = new ReflectionClass(P::class); $property = $reflection->getProperty('v'); echo $property->getValue($c); $reflection = new ReflectionClass(C::class); $property = $reflection->getProperty('v'); echo $property->getValue($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S7GmM
function name:  (null)
number of ops:  28
compiled vars:  !0 = $c, !1 = $reflection, !2 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   12     3        NEW                                              $6      'ReflectionClass'
          4        SEND_VAL_EX                                              'P'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   13     7        INIT_METHOD_CALL                                         !1, 'getProperty'
          8        SEND_VAL_EX                                              'v'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   14    11        INIT_METHOD_CALL                                         !2, 'getValue'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $11     
         14        ECHO                                                     $11
   16    15        NEW                                              $12     'ReflectionClass'
         16        SEND_VAL_EX                                              'C'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !1, $12
   17    19        INIT_METHOD_CALL                                         !1, 'getProperty'
         20        SEND_VAL_EX                                              'v'
         21        DO_FCALL                                      0  $15     
         22        ASSIGN                                                   !2, $15
   18    23        INIT_METHOD_CALL                                         !2, 'getValue'
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0  $17     
         26        ECHO                                                     $17
         27      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.63 ms | 995 KiB | 13 Q