3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); // strict types are enabled, all three examples should emit wrong key type exception ['1' => true]; $a = '1'; [$a => true]; [1 => true][$a]; // ie. emit type exception when the key type is different than it will be, ie. int for numeric input, otherwise string
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/epv5s
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '1'
    6     1        INIT_ARRAY                                       ~2      <true>, !0
          2        FREE                                                     ~2
    7     3        FETCH_DIM_R                                      ~3      <array>, !0
          4        FREE                                                     ~3
    8     5      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.62 ms | 993 KiB | 13 Q