3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { static $test; } class A { use Foo; } class B extends A { use Foo; } A::$test = 'A'; B::$test = 'B'; var_dump(A::$test, B::$test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SClLn
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'a'
   11     1        DECLARE_CLASS                                            'b', 'a'
   15     2        ASSIGN_STATIC_PROP                                       'test', 'A'
          3        OP_DATA                                                  'A'
   16     4        ASSIGN_STATIC_PROP                                       'test', 'B'
          5        OP_DATA                                                  'B'
   17     6        INIT_FCALL                                               'var_dump'
          7        FETCH_STATIC_PROP_R          unknown             ~2      'test'
          8        SEND_VAL                                                 ~2
          9        FETCH_STATIC_PROP_R          unknown             ~3      'test'
         10        SEND_VAL                                                 ~3
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class Foo: [no user functions]
Class A: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.73 ms | 1394 KiB | 15 Q