3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* get system resource precentages */ function serverStatus() { /* cpu usage */ $cpuUsage=NULL; exec('ps -aux', $processes); foreach($processes as $process){ $cols = split(' ', ereg_replace(' +', ' ', $process)); if (strpos($cols[2], '.') > -1){ $cpuUsage += floatval($cols[2]); } } $sysLoad = sys_getloadavg(); /* get raspberry pi temp */ $rawTemp = shell_exec('/opt/vc/bin/vcgencmd measure_temp'); /* trim temp= from the response */ $temp_c = round(str_replace("temp=", "", $rawTemp),2); $temp_f = round((($temp_c * 9) / 5) + 32,2); /* memory usage */ foreach(file('/proc/meminfo') as $ri) $m[strtok($ri, ':')] = strtok(''); /* displays memory used precentage */ $memory = 100 - round(($m['MemFree'] + $m['Buffers'] + $m['Cached']) / $m['MemTotal'] * 100); /* free memory in mB rounded to tenths */ $memoryFree = round($m['MemFree']/(1024), 2); /* Buffered memory in mB rounded to tenths */ $bufferedMem = round($m['Buffers']/(1024), 2); /* cached Memoty in mB and rounded to tenths */ $cachedMem = round($m['Cached']/(1024),2); /* total memory in mB rounded to tenths */ $TotleMem = round($m['MemTotal']/(1024),2); /* disk free space a gigabytes and rounded to tenths */ $freeSpace = round(disk_free_space("/")/(1024*1024*1024), 2); /* total disk space in gigabytes and rounded to tenths */ $totalSpace = round(disk_total_space("/")/(1024*1024*1024), 2); /* disk free space in precentage */ $freePrecent = round($freeSpace / $totalSpace * 100, 2); /* server uptime*/ $uptime = shell_exec("cut -d. -f1 /proc/uptime"); $days = floor($uptime/60/60/24); $hours = $uptime/60/60%24; $mins = $uptime/60%60; $secs = $uptime%60; /* current server time */ $obsTime= date("g:i a" ,time()).' on '.date("l, F d, Y" ,time()); /* build status array */ $status=array( 'cpu' => $cpuUsage.' %', 'system load' => $sysLoad, 'cpu temp_c' => $temp_c.' C', 'cpu temp_f' => $temp_f.' F', 'memory' => $memory.' %', 'memory free' => $memoryFree.' mB', 'buffered memory' => $bufferedMem.' mB', 'memory cached' => $cachedMem.' mB', 'total memory' => $TotleMem.' mB', 'free gb' => $freeSpace.' gB', 'free precent' => $freePrecent.' %', 'total gb' => $totalSpace.' gB', 'uptime' => $days.' days '.$hours.' hours '.$mins.' minutes and '.$secs.' seconds', 'observation time' => $obsTime ); return $status; } serverStatus();

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)
7.4.00.0030.01815.44
7.3.120.0000.01815.47
7.3.110.0040.01615.25
7.3.100.0100.00615.10
7.3.90.0080.00515.13
7.3.80.0050.01015.03
7.3.70.0060.00915.09
7.3.60.0080.00915.19
7.3.50.0030.01315.16
7.3.40.0080.00415.11
7.3.30.0110.00115.00
7.3.20.0070.01216.91
7.3.10.0120.01316.73
7.3.00.0130.01116.80
7.2.250.0060.01615.31
7.2.240.0120.00915.35
7.2.230.0050.01415.22
7.2.220.0030.01415.27
7.2.210.0060.01015.34
7.2.200.0060.01015.48
7.2.190.0040.01615.39
7.2.180.0140.00415.08
7.2.170.0100.01115.35
7.2.130.0200.00916.98
7.2.120.0220.01216.90
7.2.110.0210.00416.94
7.2.100.0200.00616.70
7.2.90.0190.01116.91
7.2.80.0190.01317.05
7.2.70.0270.01216.99
7.2.60.0130.01517.00
7.2.50.0180.01217.01
7.2.40.0270.00917.04
7.2.30.0270.00117.05
7.2.20.0200.01117.14
7.2.10.0180.01116.77
7.2.00.0160.01217.99
7.1.330.0070.01116.03
7.1.320.0110.00416.00
7.1.310.0070.00816.15
7.1.300.0060.00615.82
7.1.290.0110.00615.77
7.1.280.0120.00716.14
7.1.270.0070.01015.91
7.1.260.0070.01115.86
7.1.250.0150.00715.72
7.1.70.0030.00717.29
7.1.60.0120.00117.56
7.1.50.0040.01917.40
7.1.00.0030.08022.46
7.0.200.0040.01917.13
7.0.140.0000.08022.09
7.0.100.0130.04020.04
7.0.90.0200.04320.00
7.0.80.0070.04319.91
7.0.70.0100.03719.90
7.0.60.0130.07019.81
7.0.50.0030.04320.38
7.0.40.0100.06020.12
7.0.30.0100.04320.13
7.0.20.0100.04319.95
7.0.10.0070.04319.97
7.0.00.0030.04320.03
5.6.280.0130.06320.91
5.6.250.0130.05320.76
5.6.240.0030.05020.73
5.6.230.0030.04320.74
5.6.220.0000.04720.47
5.6.210.0130.03320.48
5.6.200.0130.03721.10
5.6.190.0100.03721.06
5.6.180.0030.04320.98
5.6.170.0100.03320.95
5.6.160.0070.04021.07
5.6.150.0030.04321.16
5.6.140.0030.04321.10
5.6.130.0130.03321.15
5.6.120.0070.03720.94
5.6.110.0130.03021.05
5.6.100.0070.04021.08
5.6.90.0070.04021.07
5.6.80.0070.06020.44
5.6.70.0170.07020.47
5.6.60.0070.08320.29
5.6.50.0000.05720.32
5.6.40.0100.07020.34
5.6.30.0170.05320.36
5.6.20.0070.07020.44
5.6.10.0070.04020.39
5.6.00.0030.06720.44
5.5.380.0070.04320.45
5.5.370.0030.04320.44
5.5.360.0070.04020.50
5.5.350.0030.04320.50
5.5.340.0070.04020.75
5.5.330.0100.03720.85
5.5.320.0030.04020.87
5.5.310.0030.05020.63
5.5.300.0030.04720.89
5.5.290.0030.04320.87
5.5.280.0030.04320.78
5.5.270.0000.04320.87
5.5.260.0030.04320.85
5.5.250.0000.04320.59
5.5.240.0000.04320.28
5.5.230.0030.04320.18
5.5.220.0070.06020.12
5.5.210.0030.04320.26
5.5.200.0070.08020.18
5.5.190.0170.07020.14
5.5.180.0130.06720.18
5.5.160.0130.07720.09
5.5.150.0070.05319.98
5.5.140.0130.07720.26
5.5.130.0070.08320.11
5.5.120.0170.07320.16
5.5.110.0070.07020.25
5.5.100.0100.04320.06
5.5.90.0070.08320.05
5.5.80.0100.06720.09
5.5.70.0100.08020.09
5.5.60.0230.06320.08
5.5.50.0070.07720.07
5.5.40.0070.05020.07
5.5.30.0130.07020.07
5.5.20.0100.05020.05
5.5.10.0100.04719.96
5.5.00.0100.05320.02
5.4.450.0100.04019.36
5.4.440.0070.04019.57
5.4.430.0030.04019.31
5.4.420.0030.04319.37
5.4.410.0070.03319.32
5.4.400.0070.03019.00
5.4.390.0000.05019.21
5.4.380.0070.03319.13
5.4.370.0030.04719.15
5.4.360.0070.03319.06
5.4.350.0130.06019.29
5.4.340.0130.07319.29
5.4.320.0170.05719.26
5.4.310.0070.07718.95
5.4.300.0070.07319.14
5.4.290.0000.06018.99
5.4.280.0100.07319.24
5.4.270.0070.07719.12
5.4.260.0130.06319.14
5.4.250.0030.07719.24
5.4.240.0100.04319.05
5.4.230.0100.08018.98
5.4.220.0100.05019.14
5.4.210.0070.06719.04
5.4.200.0070.08019.24
5.4.190.0100.07019.26
5.4.180.0070.08019.28
5.4.170.0130.07319.17
5.4.160.0100.07019.19
5.4.150.0070.07018.97
5.4.140.0030.06716.45
5.4.130.0070.08316.49
5.4.120.0170.07016.55
5.4.110.0070.05016.61
5.4.100.0030.04716.54
5.4.90.0070.04016.59
5.4.80.0100.04016.54
5.4.70.0070.07016.34
5.4.60.0070.07016.38
5.4.50.0070.07716.54
5.4.40.0000.06316.54
5.4.30.0100.07316.44
5.4.20.0070.07716.45
5.4.10.0170.07016.34
5.4.00.0100.07015.92
5.3.290.0070.04014.83
5.3.280.0030.08314.64
5.3.270.0130.07014.64
5.3.260.0130.04014.68
5.3.250.0070.06314.70
5.3.240.0000.08314.66
5.3.230.0030.08314.77
5.3.220.0100.07314.63
5.3.210.0100.07014.70
5.3.200.0170.06714.73
5.3.190.0030.07714.70
5.3.180.0100.07314.73
5.3.170.0100.07014.73
5.3.160.0170.05014.61
5.3.150.0130.06714.66
5.3.140.0030.05714.61
5.3.130.0100.04014.62
5.3.120.0100.07014.62
5.3.110.0170.07014.62
5.3.100.0070.08014.20
5.3.90.0030.04014.07
5.3.80.0030.06014.16
5.3.70.0270.04014.18
5.3.60.0100.07014.03
5.3.50.0230.04013.92
5.3.40.0070.08314.13
5.3.30.0000.08014.01
5.3.20.0030.08013.63
5.3.10.0030.06313.74
5.3.00.0130.07013.56
5.2.170.0270.05311.31
5.2.160.0100.02711.28
5.2.150.0100.05711.44
5.2.140.0030.06711.30
5.2.130.0070.06311.24
5.2.120.0030.06711.16
5.2.110.0270.03311.25
5.2.100.0130.04711.29
5.2.90.0070.02711.39
5.2.80.0130.05311.23
5.2.70.0070.06011.32
5.2.60.0070.03311.34
5.2.50.0070.06311.15
5.2.40.0030.06311.30
5.2.30.0030.05711.26
5.2.20.0130.05311.33
5.2.10.0030.05311.14
5.2.00.0030.06711.00
5.1.60.0030.06010.11
5.1.50.0130.04710.12
5.1.40.0070.04710.22
5.1.30.0070.05010.64
5.1.20.0030.03710.41
5.1.10.0030.03010.18
5.1.00.0030.02710.16
5.0.50.0030.0478.63
5.0.40.0000.0438.53
5.0.30.0000.0678.34
5.0.20.0000.0438.08
5.0.10.0000.0278.09
5.0.00.0070.0378.06
4.4.90.0070.0306.15
4.4.80.0100.0306.15
4.4.70.0000.0406.15
4.4.60.0000.0236.15
4.4.50.0070.0306.15
4.4.40.0000.0306.15
4.4.30.0000.0376.15
4.4.20.0000.0206.15
4.4.10.0030.0306.15
4.4.00.0030.0476.15
4.3.110.0000.0206.15
4.3.100.0000.0206.15
4.3.90.0000.0236.15
4.3.80.0000.0336.15
4.3.70.0030.0306.15
4.3.60.0000.0406.15
4.3.50.0030.0376.15
4.3.40.0030.0436.15
4.3.30.0030.0336.15
4.3.20.0030.0376.15
4.3.10.0000.0376.15
4.3.00.0030.0236.15

preferences:
32.8 ms | 400 KiB | 5 Q