3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 'ahoj'; public function fet(&$a) { } public function get() { } public function __invoke(&$a) { echo $this->a; } } $a = new A; /*$a('ahoj'); $ref = new \ReflectionMethod($a, '__invoke'); $ref->setAccessible(true); $ref->invoke($a, 'ahoj');*/ function f_a($b, &$a) { } $f = function($b, &$a) {}; $ref = new ReflectionFunction($f); $ref->invoke($f, 3, $a->get()); //$ar = array($a, 'fet'); //$a->fet(new DateTime);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3GBO
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $f, !2 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   27     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FL3GBO%3A27%240'
          4        ASSIGN                                                   !1, ~6
   28     5        NEW                                              $8      'ReflectionFunction'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $8
   30     9        INIT_METHOD_CALL                                         !2, 'invoke'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              3
         12        INIT_METHOD_CALL                                         !0, 'get'
         13        DO_FCALL                                      0  $11     
         14        SEND_VAR_NO_REF_EX                                       $11
         15        DO_FCALL                                      0          
   33    16      > RETURN                                                   1

Function f_a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3GBO
function name:  f_a
number of ops:  3
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2      > RETURN                                                   null

End of function f_a

Function %00%7Bclosure%7D%2Fin%2FL3GBO%3A27%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3GBO
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FL3GBO%3A27%240

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

End of function fet

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3GBO
function name:  get
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function get

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

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.21 ms | 939 KiB | 14 Q