3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function a() {} protected function b() {} } $a = new A(); var_dump(is_callable([$a, 'a'])); var_dump(is_callable([$a, 'b']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DZOiA
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'is_callable'
          5        INIT_ARRAY                                       ~4      !0
          6        ADD_ARRAY_ELEMENT                                ~4      'a'
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
   10    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'is_callable'
         13        INIT_ARRAY                                       ~7      !0
         14        ADD_ARRAY_ELEMENT                                ~7      'b'
         15        SEND_VAL                                                 ~7
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function a

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

End of function b

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.65 ms | 1400 KiB | 17 Q