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']);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given in /in/uM3UM:10 Stack trace: #0 /in/uM3UM(10): str_starts_with(0, 'x-') #1 /in/uM3UM(16): f(Array) #2 {main} thrown in /in/uM3UM on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
36.29 ms | 405 KiB | 5 Q