3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test { public function test() { echo $this->test . "\n"; echo get_class($this) . "\n"; } } class Foo { private $test = "bar"; use Test; } (new Foo())->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jSXKJ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'foo'
   18     1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jSXKJ
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'test'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
    8     3        FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        CONCAT                                           ~4      ~3, '%0A'
          6        ECHO                                                     ~4
    9     7      > RETURN                                                   null

End of function test

End of class Test.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.59 ms | 1393 KiB | 13 Q