3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace test; class MyPlugin { public function __construct() { add_action('foo', [__NAMESPACE__ . '\MyPlugin', 'do_something_static']); } public static function do_something_static() { echo "If you read this, calling " . __FUNCTION__ . " worked\n"; } } call_user_func( array( __NAMESPACE__ . '\MyPlugin', 'do_something_static' ) ); call_user_func( __NAMESPACE__ . '\MyPlugin::do_something_static' ); call_user_func( 'test\MyPlugin::do_something_static' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JUdlA
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_NS_FCALL_BY_NAME                                        'test%5Ccall_user_func'
          1        SEND_VAL_EX                                                  <array>
          2        DO_FCALL                                          0          
   16     3        INIT_NS_FCALL_BY_NAME                                        'test%5Ccall_user_func'
          4        SEND_VAL_EX                                                  'test%5CMyPlugin%3A%3Ado_something_static'
          5        DO_FCALL                                          0          
   17     6        INIT_NS_FCALL_BY_NAME                                        'test%5Ccall_user_func'
          7        SEND_VAL_EX                                                  'test%5CMyPlugin%3A%3Ado_something_static'
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Class test\MyPlugin:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JUdlA
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_NS_FCALL_BY_NAME                                        'test%5Cadd_action'
          1        SEND_VAL_EX                                                  'foo'
          2        SEND_VAL_EX                                                  <array>
          3        DO_FCALL                                          0          
    8     4      > RETURN                                                       null

End of function __construct

Function do_something_static:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JUdlA
function name:  do_something_static
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                         'If+you+read+this%2C+calling+do_something_static+worked%0A'
   12     1      > RETURN                                                       null

End of function do_something_static

End of class test\MyPlugin.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.76 ms | 1734 KiB | 15 Q