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

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
158.55 ms | 3269 KiB | 10 Q