3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(callable $bar) { echo __FUNCTION__, "\n"; call_user_func($bar); $bar(); } class foo { static function bar() { echo __METHOD__, "\n"; } } foo('foo::bar');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbQ4P
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 'foo%3A%3Abar'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbQ4P
function name:  foo
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ECHO                                                     'foo'
          2        ECHO                                                     '%0A'
    6     3        INIT_USER_CALL                                0          'call_user_func', !0
          4        DO_FCALL                                      0          
    7     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
    8     7      > RETURN                                                   null

End of function foo

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.19 ms | 998 KiB | 14 Q