3v4l.org

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

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

End of function bat

End of class baz.

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

End of function bar

End of class foo.

Class bar: [no user functions]
Class troofoo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.57 ms | 1401 KiB | 17 Q