3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class Example { function pub(){} function __invoke(){} } $callables = array( array('Example','pub'), 'Example::pub', new Example, ); foreach ($callables as $c) { var_dump(is_callable($c)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/uMPXa
function name:  (null)
number of ops:  20
compiled vars:  !0 = $callables, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
   11     3        INIT_ARRAY                                       ~3      <array>
   12     4        ADD_ARRAY_ELEMENT                                ~3      'Example%3A%3Apub'
   13     5        NEW                                              $4      'Example'
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~3      $4
   10     8        ASSIGN                                                   !0, ~3
   16     9      > FE_RESET_R                                       $7      !0, ->18
         10    > > FE_FETCH_R                                               $7, !1, ->18
   17    11    >   INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'is_callable'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
   16    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $7
   18    19      > RETURN                                                   1

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

End of function pub

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

End of function __invoke

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.43 ms | 1396 KiB | 19 Q