3v4l.org

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

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

End of function foo

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

End of function bar

End of class foo.

Class troofoo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.73 ms | 1396 KiB | 17 Q