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)) { $result = call_user_func_array($successCallback, array($result)); } return $result; } } class Bar { public 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/b80qg
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $bar, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   46     3        NEW                                              $6      'Bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   47     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          
   48    11        NEW                                              $11     'Zend_Auth_Result'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $11
   49    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/b80qg
function name:  my_callback
number of ops:  3
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   41     1        ECHO                                                     '+here+we+go+%28plain+function%29'
   42     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/b80qg
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 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/b80qg
function name:  authCallback
number of ops:  15
compiled vars:  !0 = $result, !1 = $successCallback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        FETCH_OBJ_R                                      ~2      'authCallback'
          2        ASSIGN                                                   !1, ~2
   20     3        INIT_FCALL                                               'is_callable'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6      > JMPZ                                                     $4, ->13
   21     7    >   INIT_USER_CALL                                0          'call_user_func_array', !1
          8        INIT_ARRAY                                       ~5      !0
          9        SEND_ARRAY                                               ~5
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0  $6      
         12        ASSIGN                                                   !0, $6
   24    13    > > RETURN                                                   !0
   25    14*     > 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/b80qg
function name:  callback
number of ops:  3
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   32     1        ECHO                                                     'herewego+'
   33     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:
152.04 ms | 1400 KiB | 15 Q