3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); /** * @param string[] $y * @see \Doctrine\DBAL\Query\Expression\ExpressionBuilder::in */ function in($y): string { foreach ($y as $v) { requireString($v); } return ''; } function requireString(string $s): void { } in([1, 2]);
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: requireString(): Argument #1 ($s) must be of type string, int given, called in /in/O7nUs on line 10 and defined in /in/O7nUs:15 Stack trace: #0 /in/O7nUs(10): requireString(1) #1 /in/O7nUs(20): in(Array) #2 {main} thrown in /in/O7nUs on line 15
Process exited with code 255.

preferences:
52.97 ms | 402 KiB | 62 Q