3v4l.org

run code in 500+ PHP versions simultaneously
<?php class C{ public $foo=5; public function foo(){echo "foo is evidently a callable function!";} } $o=new C(); if(is_int([$o, 'foo'])){ echo "foo is an integer!\n"; } if(is_callable([$o, 'foo'])){ echo "foo IS callable!\n"; }else{ echo "foo IS NOT callable!\n"; } [$o, 'foo']();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
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
filename:       /in/FsWED
function name:  (null)
number of ops:  22
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   NEW                                                  $1      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
    7     3        INIT_ARRAY                                           ~4      !0
          4        ADD_ARRAY_ELEMENT                                    ~4      'foo'
          5        TYPE_CHECK                                       16          ~4
          6      > JMPZ                                                         ~5, ->8
    8     7    >   ECHO                                                         'foo+is+an+integer%21%0A'
   10     8    >   INIT_FCALL                                                   'is_callable'
          9        INIT_ARRAY                                           ~6      !0
         10        ADD_ARRAY_ELEMENT                                    ~6      'foo'
         11        SEND_VAL                                                     ~6
         12        DO_ICALL                                             $7      
         13      > JMPZ                                                         $7, ->16
   11    14    >   ECHO                                                         'foo+IS+callable%21%0A'
   10    15      > JMP                                                          ->17
   13    16    >   ECHO                                                         'foo+IS+NOT+callable%21%0A'
   15    17    >   INIT_ARRAY                                           ~8      !0
         18        ADD_ARRAY_ELEMENT                                    ~8      'foo'
         19        INIT_DYNAMIC_CALL                                            ~8
         20        DO_FCALL                                          0          
         21      > RETURN                                                       1

Class C:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsWED
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                         'foo+is+evidently+a+callable+function%21'
          1      > RETURN                                                       null

End of function foo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.55 ms | 2686 KiB | 9 Q