3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return 'foobar'; } } class FooParent extends Foo { } $callable = [FooParent::class, 'parent::bar']; assert(\is_callable($callable)); assert(\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/pdTUN
function name:  (null)
number of ops:  20
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSERT_CHECK                                             
          2        INIT_FCALL                                               'assert'
          3        INIT_FCALL                                               'is_callable'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        SEND_VAL                                                 'assert%28%5Cis_callable%28%24callable%29%29'
          8        DO_ICALL                                                 
   17     9        ASSERT_CHECK                                             
         10        INIT_FCALL                                               'assert'
         11        INIT_USER_CALL                                0          'call_user_func', !0
         12        DO_FCALL                                      0  $4      
         13        IS_IDENTICAL                                     ~5      $4, 'foobar'
         14        SEND_VAL                                                 ~5
         15        SEND_VAL                                                 'assert%28%5Ccall_user_func%28%24callable%29+%3D%3D%3D+%27foobar%27%29'
         16        DO_ICALL                                                 
   20    17        INIT_DYNAMIC_CALL                                        !0
         18        DO_FCALL                                      0          
   24    19      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pdTUN
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/pdTUN
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.0.0


preferences:
167.52 ms | 1388 KiB | 17 Q