3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 1; define("ONE",$num); //error unexpected '$num': const ONEFUN = $num; var_dump(ONE); define("ONEZ",1); const ONEFUNZ = 1; var_dump(ONEZ, ONEFUNZ); define("ARR",[1,2,3]); const BLA = [1,2,3]; var_dump(ARR,BLA);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oG6c
function name:  (null)
number of ops:  32
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    4     1        INIT_FCALL                                               'define'
          2        SEND_VAL                                                 'ONE'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'var_dump'
          6        FETCH_CONSTANT                                   ~3      'ONE'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'define'
         10        SEND_VAL                                                 'ONEZ'
         11        SEND_VAL                                                 1
         12        DO_ICALL                                                 
    9    13        DECLARE_CONST                                            'ONEFUNZ', 1
   10    14        INIT_FCALL                                               'var_dump'
         15        FETCH_CONSTANT                                   ~6      'ONEZ'
         16        SEND_VAL                                                 ~6
         17        FETCH_CONSTANT                                   ~7      'ONEFUNZ'
         18        SEND_VAL                                                 ~7
         19        DO_ICALL                                                 
   12    20        INIT_FCALL                                               'define'
         21        SEND_VAL                                                 'ARR'
         22        SEND_VAL                                                 <array>
         23        DO_ICALL                                                 
   13    24        DECLARE_CONST                                            'BLA', <array>
   14    25        INIT_FCALL                                               'var_dump'
         26        FETCH_CONSTANT                                   ~10     'ARR'
         27        SEND_VAL                                                 ~10
         28        FETCH_CONSTANT                                   ~11     'BLA'
         29        SEND_VAL                                                 ~11
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.22 ms | 1395 KiB | 17 Q