3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP $bad = array('html', 'FileType', 'IsColor', 'MimeType', 'SectionsFound', 'YCbCrPositioning', 1, 2); #$bad = array('html', 'FileType', 'IsColor', 'MimeType', 'SectionsFound', 'YCbCrPositioning'); $url = ''; $i = ''; $width = 0; $exif = array(); function input($str) { echo $str." "; return trim(fgets(STDIN)); } $url = 'http://upload.wikimedia.org/wikipedia/commons/2/23/Lake_mapourika_NZ.jpeg'; $file = basename($url).'.exif'; $f = fopen($file, 'w'); echo "Downloading ".$file."... "; if (is_file($url)) $i = file_get_contents($url); else { $c = curl_init($url); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); $i = curl_exec($c); if (!$i) { echo curl_error($c).PHP_EOL; die(); } } if (!$i) die("bad image input.".PHP_EOL); else echo "done.".PHP_EOL; fwrite($f, $i); fclose($f); if (($itype = exif_imagetype($file)) !== IMAGETYPE_JPEG or $itype === IMAGETYPE_TIFF_II or $itype == IMAGETYPE_TIFF_MM) { die("Image file type invalid for exif data.".PHP_EOL); } $exif = exif_read_data($file); if (!$exif) die("Image file contained no exif data.".PHP_EOL); array_walk_recursive($exif, function($v, $k) use (&$width) { if (strlen($k) > $width) $width = strlen($k); }); array_walk_recursive($exif, function($v, $k) use ($width, $bad) { if (preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $v) == '') { $hex = array(); $v = str_split($v); array_walk($v, function($v, $k) use (&$hex) { $hex[$k] = dechex(ord($v)); } ); $v = 'HEX[ '.implode(" ", $hex).' ]'; } else if (is_int($v)) $v = 'INT[ '.$v.' ]'; else $v = 'STRING[ '.$v.' ]'; $lim = 90; if (strlen($v) > $lim) $v = substr($v, 0, $lim-10).' ... '.substr($v, strlen($v)-5); if (preg_match('/Thumbnail\..+/i', $k) > 0) return; if (!in_array($k, $bad) and $v !== '') echo $k.str_repeat(' ', $width-strlen($k)).' => '.$v.PHP_EOL; }); unlink($file); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0100.01017.00
8.3.50.0100.00817.45
8.3.40.0070.00718.79
8.3.30.0110.00418.71
8.3.20.0060.00318.73
8.3.10.0070.00718.88
8.3.00.0040.00819.51
8.2.180.0040.01116.75
8.2.170.0000.01422.96
8.2.160.0030.01021.19
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.53
8.2.110.0060.00322.13
8.2.100.0120.00017.84
8.2.90.0030.00617.75
8.2.80.0030.01017.97
8.2.70.0080.00017.80
8.2.60.0060.00317.93
8.2.50.0080.00018.10
8.2.40.0060.00320.59
8.2.30.0040.00418.19
8.2.20.0000.00817.78
8.2.10.0000.00817.74
8.2.00.0090.00017.87
8.1.280.0120.00325.92
8.1.270.0050.00324.66
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0060.00320.73
8.1.230.0110.00019.02
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0030.00717.35
8.1.180.0080.00018.10
8.1.170.0030.00618.50
8.1.160.0040.00418.89
8.1.150.0050.00318.64
8.1.140.0040.00417.59
8.1.130.0030.00317.88
8.1.120.0070.00017.49
8.1.110.0040.00417.50
8.1.100.0070.00017.52
8.1.90.0040.00417.48
8.1.80.0000.00717.37
8.1.70.0000.00717.43
8.1.60.0040.00417.52
8.1.50.0040.00417.54
8.1.40.0000.00817.54
8.1.30.0000.00817.66
8.1.20.0070.00017.76
8.1.10.0040.00417.48
8.1.00.0000.00917.57
8.0.300.0000.00719.88
8.0.290.0000.00817.00
8.0.280.0040.00418.60
8.0.270.0000.00717.38
8.0.260.0000.00717.03
8.0.250.0070.00017.15
8.0.240.0040.00417.05
8.0.230.0000.00717.12
8.0.220.0070.00017.10
8.0.210.0000.00717.13
8.0.200.0000.00617.09
8.0.190.0070.00317.11
8.0.180.0050.00217.06
8.0.170.0060.00317.12
8.0.160.0000.00716.97
8.0.150.0040.00417.05
8.0.140.0000.00717.05
8.0.130.0030.00313.53
8.0.120.0040.00416.98
8.0.110.0000.00716.94
8.0.100.0060.00316.89
8.0.90.0040.00416.90
8.0.80.0060.00917.04
8.0.70.0000.00917.14
8.0.60.0000.00716.98
8.0.50.0000.00716.89
8.0.30.0130.01317.08
8.0.20.0070.01117.15
8.0.10.0020.00516.94
8.0.00.0100.01316.71
7.4.330.0000.00513.04
7.4.320.0000.00816.61
7.4.300.0070.00016.70
7.4.290.0030.00316.61
7.4.280.0040.00416.54
7.4.270.0040.00416.59
7.4.260.0030.00313.29
7.4.250.0050.00316.45
7.4.240.0060.00216.47
7.4.230.0050.00216.74
7.4.220.0040.01516.52
7.4.210.0060.00916.69
7.4.200.0070.00016.44
7.4.190.0040.00416.61
7.4.160.0040.01216.59
7.4.150.0040.01416.82
7.4.140.0090.00916.70
7.4.130.0100.01016.61
7.4.120.0160.00516.53
7.4.110.0100.00716.48
7.4.100.0170.00716.52
7.4.90.0040.01516.63
7.4.80.0070.01419.39
7.4.70.0070.01016.54
7.4.60.0000.01816.57
7.4.50.0080.00016.55
7.4.40.0030.00916.66
7.4.30.0160.00716.39
7.4.00.0030.01314.77
7.3.330.0000.00613.31
7.3.320.0000.00613.27
7.3.310.0040.00416.52
7.3.300.0040.00416.36
7.3.290.0070.00716.45
7.3.280.0090.00816.50
7.3.270.0140.00316.53
7.3.260.0160.00816.46
7.3.250.0140.00316.56
7.3.240.0090.01216.53
7.3.230.0120.00816.57
7.3.210.0110.00616.66
7.3.200.0070.01016.61
7.3.190.0070.01016.59
7.3.180.0120.00816.67
7.3.170.0090.00616.37
7.3.160.0220.00016.51
7.3.120.0070.00714.98
7.3.110.0060.00914.89
7.3.100.0130.00314.98
7.3.90.0070.00715.02
7.3.80.0030.00615.15
7.3.70.0030.01415.02
7.3.60.0030.01414.84
7.3.50.0090.00615.01
7.3.40.0040.00714.78
7.3.30.0070.01014.57
7.3.20.0060.00916.61
7.3.10.0060.00616.70
7.3.00.0030.00816.47
7.2.330.0140.00416.90
7.2.320.0130.00316.61
7.2.310.0300.02416.83
7.2.300.0070.01016.90
7.2.290.0070.01016.57
7.2.240.0060.00614.87
7.2.230.0030.01314.88
7.2.220.0070.00415.38
7.2.210.0070.00715.34
7.2.200.0090.00315.24
7.2.190.0100.00715.23
7.2.180.0090.00915.15
7.2.170.0030.01214.91
7.2.160.0120.00315.15
7.2.150.0090.00617.01
7.2.140.0070.01116.76
7.2.130.0050.00616.83
7.2.120.0080.00517.03
7.2.110.0060.00516.99
7.2.100.0050.00916.79
7.2.90.0020.01117.00
7.2.80.0030.01116.80
7.2.70.0040.01116.98
7.2.60.0060.00616.72
7.2.50.0050.01116.93
7.2.40.0050.01016.96
7.2.30.0050.00916.86
7.2.20.0100.00316.91
7.2.10.0090.00616.91
7.2.00.0050.01017.62
7.1.330.0060.00615.96
7.1.320.0040.01115.58
7.1.310.0040.00815.52
7.1.300.0000.01115.87
7.1.290.0060.00915.89
7.1.280.0060.00615.84
7.1.270.0080.00615.75
7.1.260.0000.01415.99
7.1.250.0040.00715.77
7.1.200.0070.00615.72
7.1.100.0110.00018.32
7.1.70.0040.00417.16
7.1.60.0100.01419.40
7.1.50.0150.00616.64
7.1.00.0030.07722.46
7.0.200.0000.00716.43
7.0.140.0030.07322.11
7.0.110.0030.07020.18
7.0.100.0100.07019.92
7.0.90.0070.08019.98
7.0.80.0070.08020.00
7.0.70.0070.07320.00
7.0.60.0130.07720.10
7.0.50.0070.07720.48
7.0.40.0170.07319.92
7.0.30.0200.06720.03
7.0.20.0000.09020.08
7.0.10.0130.07019.95
7.0.00.0100.07720.27
5.6.260.0070.05020.71
5.6.250.0070.08720.74
5.6.240.0070.09020.67
5.6.230.0170.07320.74
5.6.220.0170.07320.65
5.6.210.0070.08320.71
5.6.200.0030.05321.15
5.6.190.0030.08721.14
5.6.180.0100.07721.18
5.6.170.0130.08020.98
5.6.160.0030.08021.31
5.6.150.0200.06721.32
5.6.140.0100.06021.11
5.6.130.0070.07721.16
5.6.120.0030.08721.05
5.6.110.0070.08721.14
5.6.100.0070.05021.15
5.6.90.0100.08021.15
5.6.80.0100.07320.56
5.6.70.0130.07320.37
5.6.60.0030.07320.47
5.6.50.0170.06720.52
5.6.40.0000.07020.37
5.6.30.0130.04320.37
5.6.20.0070.07720.43
5.6.10.0070.04720.34
5.6.00.0100.07020.62
5.5.380.0070.08020.32
5.5.370.0070.07320.58
5.5.360.0070.08020.34
5.5.350.0030.08320.50
5.5.340.0030.08720.89
5.5.330.0130.07020.97
5.5.320.0100.08020.89
5.5.310.0130.07720.72
5.5.300.0100.07020.76
5.5.290.0070.06320.72
5.5.280.0170.07020.80
5.5.270.0070.04720.74
5.5.260.0100.08021.03
5.5.250.0100.07720.87
5.5.240.0130.04320.16
5.5.230.0200.06320.38
5.5.220.0100.06720.40
5.5.210.0170.07320.27
5.5.200.0070.07020.37
5.5.190.0070.08020.18
5.5.180.0100.08020.15
5.5.160.0100.07320.33
5.5.150.0100.07720.15
5.5.140.0170.07320.27
5.5.130.0130.07720.12
5.5.120.0100.07320.34
5.5.110.0200.06720.40
5.5.100.0000.09320.31
5.5.90.0130.05320.11
5.5.80.0000.08720.19
5.5.70.0070.07320.24
5.5.60.0100.07020.12
5.5.50.0030.05020.16
5.5.40.0100.05720.18
5.5.30.0130.06020.20
5.5.20.0070.07020.23
5.5.10.0030.04020.09
5.5.00.0000.04320.04
5.4.450.0070.07719.64
5.4.440.0130.07719.42
5.4.430.0100.07319.33
5.4.420.0270.06319.35
5.4.410.0000.05319.42
5.4.400.0000.07018.99
5.4.390.0100.07719.09
5.4.380.0070.04319.19
5.4.370.0070.08319.02
5.4.360.0130.04019.01
5.4.350.0030.07719.11
5.4.340.0100.07019.31
5.4.320.0100.07319.31
5.4.310.0030.07319.19
5.4.300.0000.07719.09
5.4.290.0070.07718.96
5.4.280.0070.07318.99
5.4.270.0100.06318.99
5.4.260.0030.08019.03
5.4.250.0200.06319.10
5.4.240.0070.05019.08
5.4.230.0100.04018.98
5.4.220.0070.05318.98
5.4.210.0130.04019.13
5.4.200.0070.05019.15
5.4.190.0070.05319.08
5.4.180.0100.07019.27
5.4.170.0130.04319.17
5.4.160.0100.05319.15
5.4.150.0030.05019.21
5.4.140.0000.04016.68
5.4.130.0030.03716.43
5.4.120.0030.04316.43
5.4.110.0070.03316.46
5.4.100.0070.03016.64
5.4.90.0070.03316.37
5.4.80.0030.03316.54
5.4.70.0030.07316.52
5.4.60.0200.05716.52
5.4.50.0030.06016.54
5.4.40.0000.04316.53
5.4.30.0100.07016.42
5.4.20.0100.05316.54
5.4.10.0070.05316.52
5.4.00.0000.04015.98
5.3.290.0230.06014.72
5.3.280.0170.06714.65
5.3.270.0130.03714.65
5.3.260.0070.03314.63
5.3.250.0100.05714.68
5.3.240.0030.03714.71
5.3.230.0030.04014.61
5.3.220.0000.04314.69
5.3.210.0030.03314.57
5.3.200.0030.03714.64
5.3.190.0070.03314.62
5.3.180.0100.03014.71
5.3.170.0070.03314.70
5.3.160.0070.03714.62
5.3.150.0070.07714.60
5.3.140.0030.06314.74
5.3.130.0070.06014.68
5.3.120.0100.06014.46
5.3.110.0030.05014.58
5.3.100.0030.05314.04
5.3.90.0070.05714.10
5.3.80.0070.03314.15
5.3.70.0030.04314.05
5.3.60.0070.03314.17
5.3.50.0100.02713.98
5.3.40.0100.05714.12
5.3.30.0000.04713.95
5.3.20.0000.04013.81
5.3.10.0030.03313.78
5.3.00.0030.04713.70
5.2.170.0000.03012.99
5.2.160.0070.05012.99
5.2.150.0000.03012.99
5.2.140.0030.03012.99
5.2.130.0070.03312.99
5.2.120.0000.03012.99
5.2.110.0000.02712.99
5.2.100.0000.03012.99
5.2.90.0000.03012.99
5.2.80.0000.03712.99
5.2.70.0000.03012.99
5.2.60.0000.03012.99
5.2.50.0030.02712.99
5.2.40.0030.02712.99
5.2.30.0070.02312.99
5.2.20.0000.04312.99
5.2.10.0070.02312.99
5.2.00.0030.02312.99
5.1.60.0070.03712.99
5.1.50.0000.02712.99
5.1.40.0000.02712.99
5.1.30.0030.02712.99
5.1.20.0070.05012.99
5.1.10.0030.03012.99
5.1.00.0070.02312.99
5.0.50.0000.02312.99
5.0.40.0030.01712.99
5.0.30.0070.06012.99
5.0.20.0030.01712.99
5.0.10.0070.01312.99
5.0.00.0000.03012.99
4.4.90.0030.01312.99
4.4.80.0000.01712.99
4.4.70.0030.03012.99
4.4.60.0000.03712.99
4.4.50.0000.01712.99
4.4.40.0030.02012.99
4.4.30.0000.01712.99
4.4.20.0000.01712.99
4.4.10.0030.01712.99
4.4.00.0000.02712.99
4.3.110.0000.01712.99
4.3.100.0000.02312.99
4.3.90.0000.01712.99
4.3.80.0000.02312.99
4.3.70.0030.01312.99
4.3.60.0030.01312.99
4.3.50.0000.01712.99
4.3.40.0030.02012.99
4.3.30.0000.01312.99
4.3.20.0000.02712.99
4.3.10.0000.01712.99
4.3.00.0000.01312.99

preferences:
44.38 ms | 400 KiB | 5 Q