3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; trait aTrait { protected function one() { echo "a-one"; } } namespace Bar; use Foo\aTrait as bTrait; trait aTrait { use bTrait { one as originalOne; } protected function one() { echo "b-one"; $this->originalOne(); } } namespace Baz; use Bar\atrait; class Test { use aTrait; public function __construct() { $this->one(); } } $test = new Test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WU6Kt
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'bar%5Catrait'
   31     1        DECLARE_CLASS                                            'baz%5Ctest'
   39     2        NEW                                              $1      'Baz%5CTest'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
          5      > RETURN                                                   1

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

End of function one

End of class Foo\aTrait.

Class Bar\aTrait:
Function one:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WU6Kt
function name:  one
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'b-one'
   23     1        INIT_METHOD_CALL                                         'originalOne'
          2        DO_FCALL                                      0          
   24     3      > RETURN                                                   null

End of function one

End of class Bar\aTrait.

Class Baz\Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WU6Kt
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_METHOD_CALL                                         'one'
          1        DO_FCALL                                      0          
   36     2      > RETURN                                                   null

End of function __construct

End of class Baz\Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1394 KiB | 13 Q