3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); /** * @param array<string,mixed> $a */ function f(array $headers): void { foreach ($headers as $name => $value) { if (str_starts_with($name, 'x-')) { // ... } } } f(['0' => 'hello php']);

preferences:
36.28 ms | 404 KiB | 5 Q