3v4l.org

run code in 300+ PHP versions simultaneously
<?php $PopulationOfTexas = array( 1999 => 20.56, // in millions 2000 => 21.56, 2001 => 22.56, 2002 => 23.56 ); //generate an array sohwing the difference in each year compared to the previous year $differneces = array(); $lastyear = null; foreach($PopulationOfTexas as $k=>$v){ if(empty($lastyear)){$lastyear = $k; continue;} $differneces[$k] = $k - $lastyear; $lastyear = $k; //use this later $lastitem = array("year"=>$k, "data"=>$v); } //print_r($differneces); //get the average difference per year $count = 0; $total = 0; foreach($differneces as $k=>$v){ $count++; $total += $v; } $average = number_format(($total/$count), 2); //print_r($average); //make a prediction $predictions = array(); for($i=0;$i<4;$i++){ $year = isset($year) ? $year+1 : $lastitem["year"]+1; $prediction = isset($prediction) ? $prediction+floatval($average) : $lastitem["data"]+floatval($average); $predictions[$year] = $prediction; } print_r($predictions);

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.130.0030.00618.42
8.3.120.0070.01018.73
8.3.110.0090.00920.94
8.3.100.0030.01324.06
8.3.90.0110.00726.77
8.3.80.0060.00316.63
8.3.70.0090.00616.58
8.3.60.0070.00716.63
8.3.50.0200.01322.09
8.3.40.0110.00319.02
8.3.30.0030.01219.13
8.3.20.0040.00420.30
8.3.10.0000.00821.68
8.3.00.0080.00317.63
8.2.250.0050.00316.46
8.2.240.0070.01518.92
8.2.230.0030.00622.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0120.00016.50
8.2.190.0100.01016.58
8.2.180.0120.00618.38
8.2.170.0070.00719.04
8.2.160.0140.00322.96
8.2.150.0000.00825.66
8.2.140.0090.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00420.81
8.2.110.0040.00421.18
8.2.100.0080.00418.03
8.2.90.0040.00419.12
8.2.80.0030.00617.97
8.2.70.0030.00617.63
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0000.00820.20
8.2.30.0040.00418.16
8.2.20.0000.00817.86
8.2.10.0000.00818.18
8.2.00.0030.00618.24
8.1.300.0110.00418.59
8.1.290.0040.00418.88
8.1.280.0110.00425.92
8.1.270.0140.00420.39
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0140.00323.89
8.1.230.0040.00722.80
8.1.220.0050.00317.77
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0030.00717.37
8.1.180.0040.00418.10
8.1.170.0040.00418.74
8.1.160.0030.00622.03
8.1.150.0040.00420.66
8.1.140.0040.00417.50
8.1.130.0030.00317.63
8.1.120.0000.00717.48
8.1.110.0070.00017.52
8.1.100.0000.00717.50
8.1.90.0030.00517.47
8.1.80.0000.00717.41
8.1.70.0020.00817.46
8.1.60.0070.00717.53
8.1.50.0070.00717.54
8.1.40.0080.00417.56
8.1.30.0080.00517.63
8.1.20.0100.00317.71
8.1.10.0080.00617.62
8.1.00.0090.00517.50
8.0.300.0040.00418.77
8.0.290.0000.00816.63
8.0.280.0030.00318.41
8.0.270.0040.00417.25
8.0.260.0030.00317.29
8.0.250.0030.00316.93
8.0.240.0040.00416.98
8.0.230.0000.00816.89
8.0.220.0070.00016.91
8.0.210.0050.00316.92
8.0.200.0070.00416.94
8.0.190.0020.01016.89
8.0.180.0090.00316.94
8.0.170.0080.00416.89
8.0.160.0040.00716.83
8.0.150.0120.00016.92
8.0.140.0070.00416.91
8.0.130.0070.00315.13
8.0.120.0100.00216.96
8.0.110.0080.00416.94
8.0.100.0080.00316.91
8.0.90.0090.00316.96
8.0.80.0100.00716.89
8.0.70.0050.00616.98
8.0.60.0060.00616.87
8.0.50.0100.00316.86
8.0.30.0140.00317.12
8.0.20.0130.00617.23
8.0.10.0030.00816.97
8.0.00.0090.00916.86
7.4.330.0030.00315.16
7.4.320.0030.00316.56
7.4.300.0080.00016.51
7.4.290.0050.00516.53
7.4.280.0050.00416.54
7.4.270.0100.00316.60
7.4.260.0070.00516.56
7.4.250.0060.00616.60
7.4.240.0080.00316.58
7.4.230.0030.01016.54
7.4.220.0110.00716.62
7.4.210.0070.00716.49
7.4.200.0070.00516.51
7.4.190.0130.00416.67
7.4.180.0110.00416.63
7.4.160.0120.00616.65
7.4.150.0130.00316.91
7.4.140.0110.00817.40
7.4.130.0050.01216.54
7.4.120.0070.00916.50
7.4.110.0080.00816.54
7.4.100.0120.00416.61
7.4.90.0120.00316.57
7.4.80.0090.00517.98
7.4.70.0090.00416.35
7.4.60.0080.00516.46
7.4.50.0100.00016.38
7.4.40.0050.00916.46
7.4.30.0100.00616.49
7.4.20.0070.00516.39
7.4.10.0050.00516.33
7.4.00.0020.01115.79
7.3.330.0080.00214.64
7.3.320.0050.00514.74
7.3.310.0090.00216.36
7.3.300.0100.00216.37
7.3.290.0070.00916.38
7.3.280.0100.00716.41
7.3.270.0120.00416.81
7.3.260.0080.00816.54
7.3.250.0100.00616.43
7.3.240.0030.01416.57
7.3.230.0130.00616.46
7.3.220.0090.00716.41
7.3.210.0120.00616.47
7.3.200.0160.00317.86
7.3.190.0110.00416.42
7.3.180.0060.01016.28
7.3.170.0180.00216.51
7.3.160.0110.00416.32
7.3.150.0150.00016.14
7.3.140.0050.01016.39
7.3.130.0130.00316.27
7.3.120.0050.01016.34
7.3.110.0160.00316.30
7.3.100.0100.00516.26
7.3.90.0110.00416.62
7.3.80.0120.00416.24
7.3.70.0090.00616.48
7.3.60.0070.00716.51
7.3.50.0080.00816.55
7.3.40.0090.00516.50
7.3.30.0120.00316.49
7.3.20.0100.00516.43
7.3.10.0120.00416.27
7.3.00.0140.00216.48
7.2.340.0050.01116.30
7.2.330.0150.00616.46
7.2.320.0100.00916.69
7.2.310.0070.01016.60
7.2.300.0120.00316.51
7.2.290.0030.01316.60
7.2.280.0110.00516.39
7.2.270.0150.00016.43
7.2.260.0120.00316.28
7.2.250.0050.01016.44
7.2.240.0100.00516.54
7.2.230.0130.00216.59
7.2.220.0160.00016.33
7.2.210.0080.00816.59
7.2.200.0120.00416.48
7.2.190.0050.01016.52
7.2.180.0120.00616.41
7.2.170.0100.00516.69
7.2.160.0110.00316.63
7.2.150.0120.00416.54
7.2.140.0100.00516.52
7.2.130.0050.01016.86
7.2.120.0070.00716.77
7.2.110.0260.00016.64
7.2.100.0110.00516.82
7.2.90.0180.00016.67
7.2.80.0150.00316.70
7.2.70.0120.00316.67
7.2.60.0090.00816.77
7.2.50.0070.00516.71
7.2.40.0180.00016.61
7.2.30.0130.00416.61
7.2.20.0110.00716.62
7.2.10.0090.00916.82
7.2.00.0090.00716.63
7.1.330.0130.00815.55
7.1.320.0120.00415.39
7.1.310.0120.00315.71
7.1.300.0130.00315.49
7.1.290.0130.00415.40
7.1.280.0110.00515.67
7.1.270.0110.00415.65
7.1.260.0070.00715.50
7.1.250.0100.00515.39
7.1.240.0150.00015.37
7.1.230.0240.00415.53
7.1.220.0150.00015.64
7.1.210.0080.00815.45
7.1.200.0110.00315.66
7.1.190.0130.00315.38
7.1.180.0000.01515.61
7.1.170.0150.00015.61
7.1.160.0100.00715.39
7.1.150.0080.00815.35
7.1.140.0130.00315.31
7.1.130.0100.00615.39
7.1.120.0140.00415.57
7.1.110.0110.00515.46
7.1.100.0120.00415.50
7.1.90.0080.00815.38
7.1.80.0160.00015.64
7.1.70.0060.00816.37
7.1.60.0060.01217.59
7.1.50.0180.00825.06
7.1.40.0070.01115.71
7.1.30.0100.00515.69
7.1.20.0070.01015.50
7.1.10.0240.00315.33
7.1.00.0080.04118.99
7.0.330.0120.00415.26
7.0.320.0060.01115.17
7.0.310.0110.00515.32
7.0.300.0110.00415.11
7.0.290.0080.00815.26
7.0.280.0080.00815.34
7.0.270.0090.00615.37
7.0.260.0100.00515.12
7.0.250.0140.00715.44
7.0.240.0120.00315.29
7.0.230.0060.01015.34
7.0.220.0120.00215.36
7.0.210.0090.00415.17
7.0.200.0070.00615.98
7.0.190.0080.00615.37
7.0.180.0110.00315.34
7.0.170.0100.00515.37
7.0.160.0130.00315.36
7.0.150.0160.00015.30
7.0.140.0070.00715.36
7.0.130.0190.00217.17
7.0.120.0140.00317.30
7.0.110.0110.00417.05
7.0.100.0090.00617.22
7.0.90.0100.00517.00
7.0.80.0000.01617.00
7.0.70.0140.00317.06
7.0.60.0100.03818.53
7.0.50.0080.04017.51
7.0.40.0070.03318.65
7.0.30.0140.02318.66
7.0.20.0250.04018.58
7.0.10.0210.02718.68
7.0.00.0080.03718.56
5.6.400.0000.01515.73
5.6.390.0140.00015.87
5.6.380.0150.00015.98
5.6.370.0140.00015.72
5.6.360.0110.00415.75
5.6.350.0070.00715.68
5.6.340.0090.00615.88
5.6.330.0110.00415.89
5.6.320.0120.00315.89
5.6.310.0120.00315.99
5.6.300.0060.00615.68
5.6.290.0110.00515.76
5.6.280.0060.03918.49
5.6.270.0080.00515.86
5.6.260.0060.00815.97
5.6.250.0090.00515.88
5.6.240.0090.00516.10
5.6.230.0090.00615.97
5.6.220.0040.01115.94
5.6.210.0050.04918.28
5.6.200.0040.05017.10
5.6.190.0080.02618.18
5.6.180.2100.02718.33
5.6.170.0210.03918.37
5.6.160.0100.04018.29
5.6.150.0110.03317.17
5.6.140.0100.03917.16
5.6.130.0100.03717.18
5.6.120.0100.02818.59
5.6.110.0120.03718.52
5.6.100.0130.02618.47
5.6.90.0130.03518.46
5.6.80.0060.03918.20
5.6.70.1980.02018.25
5.6.60.0090.00516.07
5.6.50.0070.00715.89
5.6.40.0100.00516.11
5.6.30.0050.00916.06
5.6.20.0080.00515.96
5.6.10.0100.00315.83
5.6.00.0040.00915.88
5.5.380.0090.00516.19
5.5.370.0140.00016.25
5.5.360.0100.00316.00
5.5.350.0170.03818.25
5.5.340.0140.03117.00
5.5.330.0080.04218.13
5.5.320.0270.02818.19
5.5.310.0230.04118.13
5.5.300.0080.04517.00
5.5.290.0100.04116.94
5.5.280.0150.02918.27
5.5.270.0070.04418.34
5.5.260.0090.04018.22
5.5.250.0130.04518.24
5.5.240.0140.03718.28
5.5.230.0040.01015.81
5.5.220.0130.00215.90
5.5.210.0130.00316.09
5.5.200.0100.00415.71
5.5.190.0100.00315.68
5.5.180.0160.00015.86
5.5.170.0090.00515.73
5.5.160.0070.00715.87
5.5.150.0070.00715.93
5.5.140.0130.00015.79
5.5.130.0110.00415.66
5.5.120.0070.00715.86
5.5.110.0100.00315.74
5.5.100.0070.00715.84
5.5.90.0090.00515.86
5.5.80.0100.00316.12
5.5.70.0040.00816.13
5.5.60.0110.00415.94
5.5.50.0120.00015.95
5.5.40.0050.00716.07
5.5.30.0060.00616.13
5.5.20.0080.00415.91
5.5.10.0090.00515.80
5.5.00.0090.00415.72
5.4.450.0480.02316.19
5.4.440.0360.03616.15
5.4.430.0700.00616.05
5.4.420.0680.00316.29
5.4.410.0710.00116.14
5.4.400.0850.00215.94
5.4.390.0710.00116.00
5.4.380.0580.00216.08
5.4.370.0700.00216.04
5.4.360.0720.00115.94
5.4.350.0690.00015.88
5.4.340.0690.00115.87
5.4.330.0070.00412.74
5.4.320.0860.00216.11
5.4.310.0740.00115.90
5.4.300.0710.00116.05
5.4.290.0690.00216.12
5.4.280.0680.00615.94
5.4.270.0700.00016.11
5.4.260.0670.00316.01
5.4.250.0540.00315.97
5.4.240.0370.00215.97
5.4.230.0380.00015.90
5.4.220.0370.00015.90
5.4.210.0810.00315.83
5.4.200.0840.00214.80
5.4.190.0760.00015.87
5.4.180.0590.00015.80
5.4.170.0580.00216.01
5.4.160.0630.00015.85
5.4.150.0560.00315.96
5.4.140.0540.00314.63
5.4.130.0630.00014.58
5.4.120.0550.00214.65
5.4.110.0540.00214.67
5.4.100.0560.00114.75
5.4.90.0520.00514.78
5.4.80.0680.00214.63
5.4.70.0560.00014.71
5.4.60.0540.00214.62
5.4.50.0650.00214.62
5.4.40.0530.00414.49
5.4.30.0540.00214.79
5.4.20.0570.00214.64
5.4.10.0540.00214.66
5.4.00.0570.00014.40

preferences:
28.08 ms | 403 KiB | 5 Q