3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('APACHE_MIME_TYPES_URL','http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types'); function generateUpToDateMimeArray($url){ $s=array(); foreach(@explode("\n",@file_get_contents($url))as $x) if(isset($x[0])&&$x[0]!=='#'&&preg_match_all('#([^\s]+)#',$x,$out)&&isset($out[1])&&($c=count($out[1]))>1) for($i=1;$i<$c;$i++) $s[]='&nbsp;&nbsp;&nbsp;\''.$out[1][$i].'\' => \''.$out[1][0].'\''; return @sort($s)?'$mime_types = array(<br />'.implode($s,',<br />').'<br />);':false; } echo generateUpToDateMimeArray(APACHE_MIME_TYPES_URL);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /in/OpXlC:11 Stack trace: #0 /in/OpXlC(11): implode(Array, ',<br />') #1 /in/OpXlC(14): generateUpToDateMimeArray('http://svn.apac...') #2 {main} thrown in /in/OpXlC on line 11
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /in/OpXlC on line 11 $mime_types = array(<br /><br />);
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
$mime_types = array(<br /><br />);

preferences:
237.76 ms | 403 KiB | 377 Q