3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('FOO', 10); $array = array(10 => FOO, "FOO" => 20); echo $array[FOO]; echo $array["FOO"]; print $array[$array[FOO]] * $array["FOO"]; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rb2gi
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'FOO'
          2        SEND_VAL                                                 10
          3        DO_ICALL                                                 
    5     4        FETCH_CONSTANT                                   ~2      'FOO'
          5        INIT_ARRAY                                       ~3      ~2, 10
    6     6        ADD_ARRAY_ELEMENT                                ~3      20, 'FOO'
    5     7        ASSIGN                                                   !0, ~3
    8     8        FETCH_CONSTANT                                   ~5      'FOO'
          9        FETCH_DIM_R                                      ~6      !0, ~5
         10        ECHO                                                     ~6
    9    11        FETCH_DIM_R                                      ~7      !0, 'FOO'
         12        ECHO                                                     ~7
   10    13        FETCH_CONSTANT                                   ~8      'FOO'
         14        FETCH_DIM_R                                      ~9      !0, ~8
         15        FETCH_DIM_R                                      ~10     !0, ~9
         16        FETCH_DIM_R                                      ~11     !0, 'FOO'
         17        MUL                                              ~12     ~10, ~11
         18        ECHO                                                     ~12
   12    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.33 ms | 1394 KiB | 15 Q