3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test1 { public function test1() { echo $this->test; } } trait Test2 { public function test2() { echo $this->test; } } class Foo { private $test = "bar"; use Test1; } class Bar extends Foo { use Test2; } (new Foo())->test1(); (new Bar())->test1(); (new Bar())->test2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VKYQK
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'foo'
   25     1        DECLARE_CLASS                                            'bar', 'foo'
   30     2        NEW                                              $0      'Foo'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'test1'
          5        DO_FCALL                                      0          
   31     6        NEW                                              $3      'Bar'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $3, 'test1'
          9        DO_FCALL                                      0          
   32    10        NEW                                              $6      'Bar'
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $6, 'test2'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function test1

End of class Test1.

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

End of function test2

End of class Test2.

Class Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.61 ms | 1394 KiB | 13 Q