3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function __invoke() { echo "a"; }};//function() {}; $a = new A; //$a = function() { echo "b";}; $ref = new ReflectionMethod($a, '__invoke'); var_dump(is_object($a), is_callable($a),$ref); $a(); exit; function a($a) { } $b = 3; a($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/EUs3b
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a, !1 = $ref, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        NEW                                              $6      'ReflectionMethod'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              '__invoke'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    6     8        INIT_FCALL                                               'var_dump'
          9        TYPE_CHECK                                  256  ~9      !0
         10        SEND_VAL                                                 ~9
         11        INIT_FCALL                                               'is_callable'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
    7    17        INIT_DYNAMIC_CALL                                        !0
         18        DO_FCALL                                      0          
    8    19      > EXIT                                                     
   11    20*       ASSIGN                                                   !2, 3
   12    21*       INIT_FCALL                                               'a'
         22*       SEND_VAR                                                 !2
         23*       DO_FCALL                                      0          
         24*     > RETURN                                                   1

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

End of function a

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

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.48 ms | 1398 KiB | 18 Q