3v4l.org

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

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j7uIq
function name:  call
number of ops:  4
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          
   11     3      > 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/j7uIq
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.91 ms | 1403 KiB | 17 Q