3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return 42; } } $x = 'Foo::bar'; echo ( true === is_callable($x) ? 'T' : 'F' ); echo ( 42 == call_user_func($x) ? 'T' : 'F' );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/cC9g8
function name:  (null)
number of ops:  19
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'Foo%3A%3Abar'
   11     1        INIT_FCALL                                               'is_callable'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        TYPE_CHECK                                    8          $2
          5      > JMPZ                                                     ~3, ->8
          6    >   QM_ASSIGN                                        ~4      'T'
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~4      'F'
          9    >   ECHO                                                     ~4
   13    10        INIT_USER_CALL                                0          'call_user_func', !0
         11        DO_FCALL                                      0  $5      
         12        IS_EQUAL                                                 $5, 42
         13      > JMPZ                                                     ~6, ->16
         14    >   QM_ASSIGN                                        ~7      'T'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~7      'F'
         17    >   ECHO                                                     ~7
         18      > RETURN                                                   1

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.07 ms | 1388 KiB | 15 Q