3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; trait aTrait { protected function one() { echo "a-one "; } public function two() { echo "a-two "; } protected function three() { return ''; } } namespace Bar; use Foo\aTrait as bTrait; trait aTrait { use bTrait { one as originalOne; two as originalTwo; } protected function one() { echo "b-one"; $this->originalOne(); } public function two() { $this->three(); $this->originalTwo(); } } 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/2mrHS
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   DECLARE_CLASS                                            'bar%5Catrait'
   46     1        DECLARE_CLASS                                            'baz%5Ctest'
   54     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/2mrHS
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

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

End of function two

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

End of function three

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/2mrHS
function name:  one
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ECHO                                                     'b-one'
   32     1        INIT_METHOD_CALL                                         'originalOne'
          2        DO_FCALL                                      0          
   33     3      > RETURN                                                   null

End of function one

Function two:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2mrHS
function name:  two
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_METHOD_CALL                                         'three'
          1        DO_FCALL                                      0          
   38     2        INIT_METHOD_CALL                                         'originalTwo'
          3        DO_FCALL                                      0          
   39     4      > RETURN                                                   null

End of function two

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/2mrHS
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   INIT_METHOD_CALL                                         'one'
          1        DO_FCALL                                      0          
   51     2      > RETURN                                                   null

End of function __construct

End of class Baz\Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.89 ms | 1399 KiB | 13 Q