3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $private = 'private'; public $public = 'public'; } $r = new \ReflectionClass('A'); $p = $r->getProperty('private'); $p->setAccessible(true); $p->setAccessible(false); var_dump($p->getValue(new A())); $p = $r->getProperty('public'); $p->setAccessible(false); var_dump($p->getValue(new A()));
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/cA9SJ
function name:  (null)
number of ops:  39
compiled vars:  !0 = $r, !1 = $p
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   9     1        NEW                                              $3      :-6
         2        SEND_VAL_EX                                              'A'
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $3
  10     5        INIT_METHOD_CALL                                         !0, 'getProperty'
         6        SEND_VAL_EX                                              'private'
         7        DO_FCALL                                      0  $6      
         8        ASSIGN                                                   !1, $6
  11     9        INIT_METHOD_CALL                                         !1, 'setAccessible'
        10        SEND_VAL_EX                                              <true>
        11        DO_FCALL                                      0          
  12    12        INIT_METHOD_CALL                                         !1, 'setAccessible'
        13        SEND_VAL_EX                                              <false>
        14        DO_FCALL                                      0          
  13    15        INIT_FCALL                                               'var_dump'
        16        INIT_METHOD_CALL                                         !1, 'getValue'
        17        NEW                                              $10     :9
        18        DO_FCALL                                      0          
        19        SEND_VAR_NO_REF                               0          $10
        20        DO_FCALL                                      0  $12     
        21        SEND_VAR                                                 $12
        22        DO_ICALL                                                 
  15    23        INIT_METHOD_CALL                                         !0, 'getProperty'
        24        SEND_VAL_EX                                              'public'
        25        DO_FCALL                                      0  $14     
        26        ASSIGN                                                   !1, $14
  16    27        INIT_METHOD_CALL                                         !1, 'setAccessible'
        28        SEND_VAL_EX                                              <false>
        29        DO_FCALL                                      0          
  17    30        INIT_FCALL                                               'var_dump'
        31        INIT_METHOD_CALL                                         !1, 'getValue'
        32        NEW                                              $17     :20
        33        DO_FCALL                                      0          
        34        SEND_VAR_NO_REF                               0          $17
        35        DO_FCALL                                      0  $19     
        36        SEND_VAR                                                 $19
        37        DO_ICALL                                                 
        38      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.2.0