3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1395 KiB | 17 Q