3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return __METHOD__; } } function call(callable $func) { return $func(); } // works $callable = array('Foo', 'bar'); var_dump($callable()); var_dump(call($callable)); // Call to undefined function Foo::bar() $callable = 'Foo::bar'; // var_dump($callable()); var_dump(call($callable));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZsiO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'var_dump'
          2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $2      
          4        SEND_VAR                                                 $2
          5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'call'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
   20    12        ASSIGN                                                   !0, 'Foo%3A%3Abar'
   22    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'call'
         15        SEND_VAR                                                 !0
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZsiO
function name:  call
number of ops:  5
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   11     4*     > RETURN                                                   null

End of function call

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.69 ms | 1399 KiB | 17 Q