3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define class constant linking to a not defined constant interface Foo { const FOO = FOO; } interface Bar { const BAR = BAR; } echo "Define the linked constant AFTER reading:\n"; Foo::FOO; define('FOO', 'Value of FOO'); var_dump(Foo::FOO); echo "Define the linked constant BEFORE reading:\n"; 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/NGfkv
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'Define+the+linked+constant+AFTER+reading%3A%0A'
   13     1        FETCH_CLASS_CONSTANT                             ~0      'Foo', 'FOO'
          2        FREE                                                     ~0
   14     3        INIT_FCALL                                               'define'
          4        SEND_VAL                                                 'FOO'
          5        SEND_VAL                                                 'Value+of+FOO'
          6        DO_ICALL                                                 
   15     7        INIT_FCALL                                               'var_dump'
          8        FETCH_CLASS_CONSTANT                             ~2      'Foo', 'FOO'
          9        SEND_VAL                                                 ~2
         10        DO_ICALL                                                 
   17    11        ECHO                                                     'Define+the+linked+constant+BEFORE+reading%3A%0A'
   18    12        INIT_FCALL                                               'define'
         13        SEND_VAL                                                 'BAR'
         14        SEND_VAL                                                 'Value+of+BAR'
         15        DO_ICALL                                                 
   19    16        INIT_FCALL                                               'var_dump'
         17        FETCH_CLASS_CONSTANT                             ~5      'Bar', 'BAR'
         18        SEND_VAL                                                 ~5
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.43 ms | 1395 KiB | 17 Q