3v4l.org

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

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

End of function foo

End of class ExampleTrait.

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

End of function foo

End of class ExampleClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.93 ms | 1393 KiB | 13 Q