3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { /** * @param callable $callback * @return Rocket_Auth_Adapter_Interface */ public function registerAuthCallback($callback) { $this->authCallback = $callback; } /** * @param Zend_Auth_Result $result * @return Zend_Auth_Result */ public function authCallback(Zend_Auth_Result $result) { $successCallback = $this->authCallback; if (is_callable($successCallback, false, $callablename)) { var_dump($callablename); $callablename($result); //$result = call_user_func_array($successCallback, array($result)); } return $result; } } class Bar { public static function callback(Zend_Auth_Result $result) { echo 'herewego '; } } class Zend_Auth_Result { } function my_callback(Zend_Auth_Result $result) { echo ' here we go (plain function)'; } $foo = new Foo(); $bar = new Bar(); $foo->registerAuthCallback(array($bar, 'callback')); $result = new Zend_Auth_Result(); $foo->authCallback($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rtvr4
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $bar, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   48     3        NEW                                              $6      'Bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   49     6        INIT_METHOD_CALL                                         !0, 'registerAuthCallback'
          7        INIT_ARRAY                                       ~9      !1
          8        ADD_ARRAY_ELEMENT                                ~9      'callback'
          9        SEND_VAL_EX                                              ~9
         10        DO_FCALL                                      0          
   50    11        NEW                                              $11     'Zend_Auth_Result'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $11
   51    14        INIT_METHOD_CALL                                         !0, 'authCallback'
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function my_callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rtvr4
function name:  my_callback
number of ops:  3
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV                                             !0      
   43     1        ECHO                                                     '+here+we+go+%28plain+function%29'
   44     2      > RETURN                                                   null

End of function my_callback

Class Foo:
Function registerauthcallback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rtvr4
function name:  registerAuthCallback
number of ops:  4
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'authCallback'
          2        OP_DATA                                                  !0
   11     3      > RETURN                                                   null

End of function registerauthcallback

Function authcallback:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Rtvr4
function name:  authCallback
number of ops:  17
compiled vars:  !0 = $result, !1 = $successCallback, !2 = $callablename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        FETCH_OBJ_R                                      ~3      'authCallback'
          2        ASSIGN                                                   !1, ~3
   20     3        INIT_FCALL                                               'is_callable'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 <false>
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $5      
          8      > JMPZ                                                     $5, ->15
   21     9    >   INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   22    12        INIT_DYNAMIC_CALL                                        !2
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   26    15    > > RETURN                                                   !0
   27    16*     > RETURN                                                   null

End of function authcallback

End of class Foo.

Class Bar:
Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rtvr4
function name:  callback
number of ops:  3
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        ECHO                                                     'herewego+'
   35     2      > RETURN                                                   null

End of function callback

End of class Bar.

Class Zend_Auth_Result: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.81 ms | 1400 KiB | 17 Q