3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 'ahoj'; private function __invoke(&$a) { echo $this->a; } } $a = new A; //$a('ahoj'); $ref = new \ReflectionMethod($a, '__invoke'); $ref->setAccessible(true); $ref->invoke($a, 'ahoj');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OUH5P
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        NEW                                              $5      'ReflectionMethod'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              '__invoke'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   15     8        INIT_METHOD_CALL                                         !1, 'setAccessible'
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
   16    11        INIT_METHOD_CALL                                         !1, 'invoke'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAL_EX                                              'ahoj'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class A:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OUH5P
function name:  __invoke
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_R                                      ~1      'a'
          2        ECHO                                                     ~1
    7     3      > RETURN                                                   null

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.01 ms | 1393 KiB | 13 Q