3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CallBySelf { public static function foo() { echo 'Foo', PHP_EOL; } public static function testCall() { $method = [self::class, 'foo']; var_dump(is_callable($method)); echo 'Call via call_user_func: '; call_user_func($method); echo 'Direct call: '; $method(); } } CallBySelf::testCall();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xkkuf
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'CallBySelf', 'testCall'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function foo

Function testcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xkkuf
function name:  testCall
number of ops:  14
compiled vars:  !0 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'is_callable'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   15     7        ECHO                                                     'Call+via+call_user_func%3A+'
   16     8        INIT_USER_CALL                                0          'call_user_func', !0
          9        DO_FCALL                                      0          
   18    10        ECHO                                                     'Direct+call%3A+'
   19    11        INIT_DYNAMIC_CALL                                        !0
         12        DO_FCALL                                      0          
   20    13      > RETURN                                                   null

End of function testcall

End of class CallBySelf.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.48 ms | 1395 KiB | 17 Q