3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Lol { const TEST = 'Lol'; } class Foo extends Lol { const TEST = 'Foo'; } class Bar extends Lol {} $foo = new Foo(); var_dump($foo::TEST); $bar = new Bar(); var_dump($bar::TEST);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ER7NF
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_FCALL                                               'var_dump'
          4        FETCH_CLASS                                   0  $5      !0
          5        FETCH_CLASS_CONSTANT                             ~6      $5, 'TEST'
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
   17     8        NEW                                              $8      'Bar'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
   18    11        INIT_FCALL                                               'var_dump'
         12        FETCH_CLASS                                   0  $11     !1
         13        FETCH_CLASS_CONSTANT                             ~12     $11, 'TEST'
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1394 KiB | 15 Q