3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function __invoke() {} } function bar(callable $foo) {} var_dump(is_callable(new foo)); bar(new foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nGdsU
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_callable'
          2        NEW                                              $0      'foo'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   10     8        INIT_FCALL                                               'bar'
          9        NEW                                              $4      'foo'
         10        DO_FCALL                                      0          
         11        SEND_VAR                                                 $4
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nGdsU
function name:  bar
number of ops:  2
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function bar

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

End of function __invoke

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
204.99 ms | 1402 KiB | 18 Q