3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define class constant linking to a not defined constant class Foo { const FOO = FOO; } class Bar { const BAR = BAR; } // define the linked constant AFTER reading Foo::FOO; define('FOO', 'Value of FOO'); var_dump(Foo::FOO); // define the linked constant BEFORE reading define('BAR', 'Value of BAR'); var_dump(Bar::BAR);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lPf4b
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_CLASS_CONSTANT                             ~0      'Foo', 'FOO'
          1        FREE                                                     ~0
   14     2        INIT_FCALL                                               'define'
          3        SEND_VAL                                                 'FOO'
          4        SEND_VAL                                                 'Value+of+FOO'
          5        DO_ICALL                                                 
   15     6        INIT_FCALL                                               'var_dump'
          7        FETCH_CLASS_CONSTANT                             ~2      'Foo', 'FOO'
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'BAR'
         12        SEND_VAL                                                 'Value+of+BAR'
         13        DO_ICALL                                                 
   19    14        INIT_FCALL                                               'var_dump'
         15        FETCH_CLASS_CONSTANT                             ~5      'Bar', 'BAR'
         16        SEND_VAL                                                 ~5
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.54 ms | 1394 KiB | 17 Q