3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public static function bar() { return 'foobar'; } } class FooParent extends Foo { } $callable = [FooParent::class, 'Foo::bar']; var_dump(\is_callable($callable)); var_dump(\call_user_func($callable) === 'foobar'); // Fail $callable();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QULq6
function name:  (null)
number of ops:  16
compiled vars:  !0 = $callable
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                       !0, <array>
   15     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                                                     
   17     7        INIT_FCALL                                                   'var_dump'
          8        INIT_USER_CALL                                    0          'call_user_func', !0
          9        DO_FCALL                                          0  $4      
         10        IS_IDENTICAL                                         ~5      $4, 'foobar'
         11        SEND_VAL                                                     ~5
         12        DO_ICALL                                                     
   20    13        INIT_DYNAMIC_CALL                                            !0
         14        DO_FCALL                                          0          
   24    15      > RETURN                                                       1

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

End of function bar

End of class Foo.

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

End of function bar

End of class FooParent.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.68 ms | 2181 KiB | 15 Q