3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = array( "content-type": "application/json", "accept": "text/html", ) $h = array(); foreach ($headers as $key => $value) { $h[] = $key . ':' . $value; } print_r($h);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Parse error: syntax error, unexpected ':', expecting ')' in /in/m5PpK on line 4
Process exited with code 255.

preferences:
173.87 ms | 940 KiB | 37 Q