3v4l.org

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

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/raeDl
function name:  a
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 a

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

End of function ab

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

End of function __invke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.54 ms | 1403 KiB | 18 Q