3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C{ public $foo; public function __construct() { $this->foo = array($this, 'foo'); } 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 = 6, Position 2 = 7
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/3s0uWo
function name:  (null)
number of ops:  18
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    8     3        FETCH_OBJ_R                                      ~4      !0, 'foo'
          4        TYPE_CHECK                                   16          ~4
          5      > JMPZ                                                     ~5, ->7
    9     6    >   ECHO                                                     'foo+is+an+integer%21%0A'
   11     7    >   INIT_FCALL                                               'is_callable'
          8        FETCH_OBJ_R                                      ~6      !0, 'foo'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11      > JMPZ                                                     $7, ->14
   12    12    >   ECHO                                                     'foo+IS+callable%21%0A'
   11    13      > JMP                                                      ->15
   14    14    >   ECHO                                                     'foo+IS+NOT+callable%21%0A'
   16    15    >   INIT_METHOD_CALL                                         !0, 'foo'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3s0uWo
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       ~1      
          1        INIT_ARRAY                                       ~2      ~1
          2        ADD_ARRAY_ELEMENT                                ~2      'foo'
          3        ASSIGN_OBJ                                               'foo'
          4        OP_DATA                                                  ~2
          5      > RETURN                                                   null

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3s0uWo
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     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.0.0


preferences:
284.22 ms | 1014 KiB | 14 Q