3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 5; } $a = new A(); $rf = new ReflectionClass($a); $pr = $rf->getProperty('a'); $pr->setAccesible(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/rTDlp
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $rf, !2 = $pr, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    8     3        NEW                                              $7      'ReflectionClass'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
    9     7        INIT_METHOD_CALL                                         !1, 'getProperty'
          8        SEND_VAL_EX                                              'a'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !2, $10
   10    11        INIT_METHOD_CALL                                         !2, 'setAccesible'
         12        SEND_VAL_EX                                              <true>
         13        DO_FCALL                                      0          
   11    14        INIT_METHOD_CALL                                         !2, 'getValue'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !3, $13
   12    18        ECHO                                                     !3
   13    19        FETCH_OBJ_R                                      ~15     !0, 'a'
         20        ECHO                                                     ~15
         21      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1394 KiB | 13 Q