3v4l.org

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

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.43 ms | 1394 KiB | 13 Q