3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public function foo() { var_dump(method_exists($this, 'bar')); } } class Bar { use Foo; public function bar() {} } $bar = new Bar(); $bar->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vJno5
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'bar'
   16     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4        INIT_METHOD_CALL                                         !0, 'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vJno5
function name:  foo
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'method_exists'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 'bar'
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
    7     8      > RETURN                                                   null

End of function foo

End of class Foo.

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

End of function bar

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.93 ms | 1395 KiB | 17 Q