3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(method_exists('ArrayObject', 'offsetSet')); // output: true var_export(is_callable(array(new ArrayObject, 'offsetSet'))); // output: true var_export(is_callable(array('ArrayObject', 'offsetSet'))); // output: false die; class A { static function b() { return 'soy b static'; } function a() { return 'soy a'; } } //$z=new a; //var_dump(is_callable($z::b())); $b=[new a, 'b']; var_dump(is_callable($b, false, $ret)); var_dump($ret); var_dump(get_defined_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/fElZm
function name:  (null)
number of ops:  46
compiled vars:  !0 = $b, !1 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'method_exists'
          2        SEND_VAL                                                 'ArrayObject'
          3        SEND_VAL                                                 'offsetSet'
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'var_export'
          8        INIT_FCALL                                               'is_callable'
          9        NEW                                              $4      'ArrayObject'
         10        DO_FCALL                                      0          
         11        INIT_ARRAY                                       ~6      $4
         12        ADD_ARRAY_ELEMENT                                ~6      'offsetSet'
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
    6    17        INIT_FCALL                                               'var_export'
         18        INIT_FCALL                                               'is_callable'
         19        SEND_VAL                                                 <array>
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                                 
   13    23      > EXIT                                                     
   33    24*       NEW                                              $11     'a'
         25*       DO_FCALL                                      0          
         26*       INIT_ARRAY                                       ~13     $11
         27*       ADD_ARRAY_ELEMENT                                ~13     'b'
         28*       ASSIGN                                                   !0, ~13
   35    29*       INIT_FCALL                                               'var_dump'
         30*       INIT_FCALL                                               'is_callable'
         31*       SEND_VAR                                                 !0
         32*       SEND_VAL                                                 <false>
         33*       SEND_REF                                                 !1
         34*       DO_ICALL                                         $15     
         35*       SEND_VAR                                                 $15
         36*       DO_ICALL                                                 
   38    37*       INIT_FCALL                                               'var_dump'
         38*       SEND_VAR                                                 !1
         39*       DO_ICALL                                                 
   41    40*       INIT_FCALL                                               'var_dump'
         41*       INIT_FCALL                                               'get_defined_vars'
         42*       DO_ICALL                                         $18     
         43*       SEND_VAR                                                 $18
         44*       DO_ICALL                                                 
         45*     > RETURN                                                   1

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

End of function b

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

End of function a

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.25 ms | 1400 KiB | 23 Q