3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class WithTrailingComma { public function run(): void { $array = [1, 2, 3]; $this->map( $array, var_dump( ..., ) ); } private function map(array $items, callable $callback): void { foreach($items as $i) { $callback($i); } } }
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
Parse error: syntax error, unexpected token "," in /in/p6XC3 on line 12
Process exited with code 255.

preferences:
42.05 ms | 788 KiB | 3 Q