3v4l.org

run code in 300+ PHP versions simultaneously
<?php // An example callback function function my_callback_function() { echo 'hello world!'; } // An example callback method class MyClass { static function myCallbackMethod() { echo 'Hello World!'; } } // Type 1: Simple callback call_user_func('my_callback_function'); // Type 2: Static class method call call_user_func(array('MyClass', 'myCallbackMethod')); // Type 3: Object method call $obj = new MyClass(); call_user_func(array($obj, 'myCallbackMethod')); // Type 4: Static class method call (As of PHP 5.2.3) call_user_func('MyClass::myCallbackMethod'); // Type 5: Relative static class method call (As of PHP 5.3.0) class A { public static function who() { echo "A\n"; } } class B extends A { public static function who() { echo "B\n"; } } call_user_func(array('B', 'parent::who')); // A ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aI0bO
function name:  (null)
number of ops:  16
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'my_callback_function'
          1        DO_FCALL                                      0          
   19     2        INIT_USER_CALL                                0          'call_user_func', <array>
          3        DO_FCALL                                      0          
   22     4        NEW                                              $3      'MyClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   23     7        INIT_ARRAY                                       ~6      !0
          8        ADD_ARRAY_ELEMENT                                ~6      'myCallbackMethod'
          9        INIT_USER_CALL                                0          'call_user_func', ~6
         10        DO_FCALL                                      0          
   26    11        INIT_USER_CALL                                0          'call_user_func', 'MyClass%3A%3AmyCallbackMethod'
         12        DO_FCALL                                      0          
   41    13        INIT_USER_CALL                                0          'call_user_func', <array>
         14        DO_FCALL                                      0          
   42    15      > RETURN                                                   1

Function my_callback_function:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aI0bO
function name:  my_callback_function
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'hello+world%21'
    6     1      > RETURN                                                   null

End of function my_callback_function

Class MyClass:
Function mycallbackmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aI0bO
function name:  myCallbackMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Hello+World%21'
   12     1      > RETURN                                                   null

End of function mycallbackmethod

End of class MyClass.

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

End of function who

End of class A.

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

End of function who

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.22 ms | 1403 KiB | 14 Q