3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test1 { private function test() {echo "OK";} } trait Test2 { use Test1 { test as testRedirect; } private function test() {$this->testRedirect(); echo " OK 2";} } class TestClass1 { use Test2; public function testIt() { $this->test(); } } $test = new TestClass1(); $test->testIt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2I5tG
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'test2'
   15     1        DECLARE_CLASS                                            'testclass1'
   26     2        NEW                                              $1      'TestClass1'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   27     5        INIT_METHOD_CALL                                         !0, 'testIt'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function test

End of class Test1.

Class Test2:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2I5tG
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_METHOD_CALL                                         'testRedirect'
          1        DO_FCALL                                      0          
          2        ECHO                                                     '+OK+2'
          3      > RETURN                                                   null

End of function test

End of class Test2.

Class TestClass1:
Function testit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2I5tG
function name:  testIt
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_METHOD_CALL                                         'test'
          1        DO_FCALL                                      0          
   22     2      > RETURN                                                   null

End of function testit

End of class TestClass1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.94 ms | 1399 KiB | 13 Q