3v4l.org

run code in 300+ PHP versions simultaneously
<?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function storefile() { $filename = "10mb.test"; //$time_start = microtime_float(); $filecontent = file_get_contents("http://v2.ustreamix.com/stream.php?id=movies-thriller"); //$time_end = microtime_float(); //$time = $time_end - $time_start; //$speed = 10 / $time; //echo "File Downloaded with" . $speed . " Mb/s of speed."; apc_store($filename,$filecontent); } function fetchfile() { $filename = "10mb.test"; $file = apc_fetch($filename); $quoted = sprintf('"%s"', addcslashes(basename($filename), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); echo $file; } storefile(); fetchfile();

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.0.120.0080.00013.64
8.0.110.0030.00313.75
8.0.100.0030.00313.62
8.0.90.0000.00613.61
8.0.80.0060.00013.63
8.0.70.0030.00313.62
8.0.60.0060.00013.64
8.0.50.0000.00713.51
8.0.30.0030.00313.61
8.0.20.0030.00313.69
8.0.10.0060.00013.57
8.0.00.0040.00413.69
7.4.250.0060.00013.66
7.4.240.0000.00613.54
7.4.230.0130.00213.55
7.4.220.0060.00613.67
7.4.210.0060.00613.55
7.4.200.0110.00013.45
7.4.190.0000.01213.63
7.4.180.0040.00813.61
7.4.160.0060.00613.63
7.4.150.0000.01213.51
7.4.140.0090.00313.52
7.4.130.0120.00013.54
7.4.120.0050.00713.46
7.4.110.0110.00013.49
7.4.100.0040.00813.62
7.4.90.0120.00013.53
7.4.80.0040.00813.55
7.4.70.0120.00013.56
7.4.60.0120.00013.54
7.4.50.0090.00313.35
7.4.40.0060.00613.25
7.4.30.0070.00513.50
7.4.20.0040.00813.43
7.4.10.0000.01213.38
7.4.00.0060.00614.21
7.3.310.0070.00713.45
7.3.300.0090.00513.43
7.3.290.0090.00613.52
7.3.280.0140.00013.43
7.3.270.0070.00713.49
7.3.260.0070.00713.53
7.3.250.0090.00413.35
7.3.240.0060.00613.53
7.3.230.0130.00013.43
7.3.220.0060.00613.28
7.3.210.0050.00513.25
7.3.200.0090.00313.36
7.3.190.0120.00013.35
7.3.180.0130.00013.34
7.3.170.0090.00513.32
7.3.160.0120.00013.44
7.3.150.0120.00013.22
7.3.140.0090.00413.35
7.3.130.0090.00413.32
7.3.120.0070.00914.05
7.3.110.0100.00514.24
7.3.100.0110.00513.98
7.3.90.0090.00314.44
7.3.80.0090.00414.25
7.3.70.0050.00614.11
7.3.60.0080.00614.31
7.3.50.0060.00814.20
7.3.40.0070.00614.27
7.3.30.0080.00314.20
7.3.20.0090.00416.04
7.3.10.0060.00816.12
7.3.00.0070.00315.99
7.2.340.0080.00413.48
7.2.330.0140.00013.38
7.2.320.0110.00213.38
7.2.310.0100.00313.40
7.2.300.0120.00013.54
7.2.290.0130.00013.59
7.2.280.0040.00913.50
7.2.270.0130.00013.40
7.2.260.0100.00213.54
7.2.250.0100.00714.41
7.2.240.0090.00714.46
7.2.230.0070.00814.41
7.2.220.0060.00814.23
7.2.210.0060.01014.29
7.2.200.0050.00714.37
7.2.190.0060.00914.36
7.2.180.0100.00314.34
7.2.170.0080.00514.23
7.2.160.0120.00013.66
7.2.150.0100.00315.38
7.2.140.0060.00615.29
7.2.130.0040.00915.55
7.2.120.0030.00915.45
7.2.110.0120.00015.50
7.2.100.0080.00415.50
7.2.90.0080.00515.54
7.2.80.0090.00315.54
7.2.70.0140.00015.54
7.2.60.0070.00716.15
7.2.50.0040.00915.29
7.2.40.0070.00715.28
7.2.30.0080.00515.30
7.2.20.0060.00715.48
7.2.10.0100.00315.35
7.2.00.0070.00717.51
7.1.330.0100.00515.24
7.1.320.0110.00215.20
7.1.310.0050.00714.95
7.1.300.0080.00615.03
7.1.290.0070.00815.18
7.1.280.0100.00315.10
7.1.270.0060.00815.11
7.1.260.0060.00815.08
7.1.250.0130.00014.17
7.1.240.0080.00414.31
7.1.230.0000.01314.39
7.1.220.0040.00914.29
7.1.210.0100.00314.27
7.1.200.0110.00314.25
7.1.190.0110.00414.25
7.1.180.0140.00014.41
7.1.170.0130.00014.19
7.1.160.0100.00414.41
7.1.150.0100.00514.37
7.1.140.0070.00714.19
7.1.130.0100.00514.36
7.1.120.0140.00014.16
7.1.110.0000.01314.30
7.1.100.0080.00616.35
7.1.90.0150.00014.20
7.1.80.0080.00714.23
7.1.70.0110.00715.78
7.1.60.0170.01224.71
7.1.50.0130.01424.59
7.1.40.0170.01424.47
7.1.30.0170.00924.61
7.1.20.0270.00624.56
7.1.10.0050.01115.44
7.1.00.0050.01415.57
7.0.330.0140.00014.38
7.0.320.0090.00414.18
7.0.310.0050.00914.20
7.0.300.0130.00014.33
7.0.290.0070.00714.17
7.0.280.0050.00914.34
7.0.270.0110.00414.09
7.0.260.0160.00014.11
7.0.250.0100.00314.46
7.0.240.0110.00314.41
7.0.230.0080.00514.21
7.0.220.0070.00714.14
7.0.210.0040.00914.36
7.0.200.0120.00715.63
7.0.190.0140.00715.69
7.0.180.0090.01015.31
7.0.170.0050.01315.42
7.0.160.0120.00715.33
7.0.150.0080.00815.19
7.0.140.0110.00615.24
7.0.130.0150.00315.52
7.0.120.0080.00915.35
7.0.110.0100.00815.36
7.0.100.0110.00715.21
7.0.90.0110.00615.35
7.0.80.0130.00415.33
7.0.70.0100.00915.43
7.0.60.0100.00815.26
7.0.50.0090.00815.22
7.0.40.0100.00715.35
7.0.30.0080.00715.37
7.0.20.0090.00615.44
7.0.10.0130.00315.46
7.0.00.0100.00515.32
5.6.400.0120.00012.75
5.6.390.0070.00412.92
5.6.380.0110.00012.83
5.6.370.0110.00012.87
5.6.360.0110.00012.70
5.6.350.0000.01112.87
5.6.340.0000.01112.82
5.6.330.0110.00012.86
5.6.320.0110.00012.86
5.6.310.0080.00412.77
5.6.300.0060.00512.52
5.6.290.0120.00012.83
5.6.280.0090.00312.96
5.6.270.0060.00612.68
5.6.260.0070.00412.59
5.6.250.0060.00612.71
5.6.240.0070.00412.77
5.6.230.0120.00012.61
5.6.220.0120.00012.95
5.6.210.0040.00812.83
5.6.200.0060.00612.75
5.6.190.0090.00312.75
5.6.180.0090.00312.83
5.6.170.0090.00312.80
5.6.160.0110.00012.82
5.6.150.0080.00412.97
5.6.140.0080.00413.00
5.6.130.0110.00013.00
5.6.120.0110.00012.93
5.6.110.0070.00412.94
5.6.100.0090.00312.76
5.6.90.0090.00212.80
5.6.80.0080.00312.62
5.6.70.0110.00012.86
5.6.60.0120.00012.69
5.6.50.0090.00312.59
5.6.40.0080.00412.64
5.6.30.0090.00312.55
5.6.20.0110.00012.64
5.6.10.0110.00012.74
5.6.00.0050.00512.63

preferences:
46.03 ms | 401 KiB | 5 Q