3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test1 { public function test1() { echo $this->test; } } trait Test2 { public function test1() { echo $this->test; } } class Foo { private $test = "bar"; use Test1; } class Bar extends Foo { use Test2; } (new Foo())->test1(); (new Bar())->test2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgSa1
function name:  (null)
number of ops:  11
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          
   32     6        NEW                                              $3      'Bar'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $3, 'test2'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Test1:
Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgSa1
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 test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgSa1
function name:  test1
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 test1

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:
152.67 ms | 1394 KiB | 13 Q