3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv=<<<CSV Tom Brady,NE,385,581,4577,32,8 Philip Rivers,LAC,360,575,4515,28,10 Matthew Stafford,DET,371,565,4446,29,10 Drew Brees,NO,386,536,4334,23,8 Ben Roethlisberger,PIT,360,561,4251,28,14 Matt Ryan,ATL,342,529,4095,20,12 Kirk Cousins,WAS,347,540,4093,27,13 Alex Smith,KC,341,505,4042,26,5 Russell Wilson,SEA,339,553,3983,34,11 Jared Goff,LA,296,477,3804,28,7 Blake Bortles,JAX,315,523,3687,21,13 Case Keenum,MIN,325,481,3547,22,7 Jameis Winston,TB,282,442,3504,19,11 Derek Carr,OAK,323,515,3496,22,13 Eli Manning,NYG,352,571,3468,19,13 Dak Prescott,DAL,308,490,3324,22,13 Andy Dalton,CIN,297,496,3320,25,12 Cam Newton,CAR,291,492,3302,22,16 Carson Wentz,PHI,265,440,3296,33,7 Marcus Mariota,TEN,281,453,3232,13,15 Joe Flacco,BAL,352,549,3141,18,13 Jacoby Brissett,IND,276,469,3098,13,7 Josh McCown,NYJ,267,397,2926,18,9 CSV; function Calculate($completions, $attempts, $yards, $touchdowns, $interceptions){ $result=[ min(2.375, ($completions/$attempts - .3) * 5), min(2.375, ($yards/$attempts - 3) * .25), min(2.375, $touchdowns/$attempts * 20), min(2.375, 2.375 - ($interceptions/$attempts *25)) ]; return round(array_sum($result)/6*100, 2); // calculated passingRate } foreach(explode("\n",$csv) as $line){ list($name,$team,$completions,$attempts,$yards,$touchdowns,$interceptions)=str_getcsv($line,","); $NFL_Stats[]=['team'=>$team,'name'=>$name,'passingRate'=>Calculate($completions, $attempts, $yards, $touchdowns, $interceptions)]; } usort($NFL_Stats,function($a,$b){return $b['passingRate']<=>$a['passingRate'];}); // order by passingRate DESC var_export($NFL_Stats);

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.4.130.0110.00917.79
8.4.120.0120.00820.20
8.4.110.0090.01218.81
8.4.100.0090.00418.79
8.4.90.0140.00520.49
8.4.80.0100.00620.38
8.4.70.0110.00818.16
8.4.60.0110.01118.90
8.4.50.0050.00318.94
8.4.40.0060.01519.56
8.4.30.0130.00619.75
8.4.20.0070.01319.77
8.4.10.0070.00319.85
8.3.260.0130.00416.56
8.3.250.0090.00518.80
8.3.240.0090.01016.63
8.3.230.0100.01116.56
8.3.220.0030.00419.12
8.3.210.0120.00716.52
8.3.200.0040.00516.86
8.3.190.0090.01016.93
8.3.180.0090.00916.97
8.3.170.0090.00920.72
8.3.160.0090.00917.33
8.3.150.0100.01017.14
8.3.140.0070.01119.01
8.3.130.0000.00818.49
8.3.120.0150.00618.87
8.3.110.0090.00020.94
8.3.100.0030.00624.06
8.3.90.0060.00326.77
8.3.80.0060.00319.36
8.3.70.0200.00316.75
8.3.60.0160.00616.75
8.3.50.0100.00717.40
8.3.40.0070.00718.92
8.3.30.0040.01119.02
8.3.20.0050.00221.85
8.3.10.0000.00823.64
8.3.00.0090.00022.12
8.2.290.0130.00620.51
8.2.280.0020.00718.66
8.2.270.0200.00019.03
8.2.260.0040.01418.15
8.2.250.0000.00816.61
8.2.240.0030.00717.26
8.2.230.0050.00322.58
8.2.220.0030.00637.54
8.2.210.0080.00826.77
8.2.200.0030.00918.88
8.2.190.0140.00416.58
8.2.180.0140.00716.45
8.2.170.0030.01422.96
8.2.160.0100.00720.14
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.76
8.2.110.0100.00021.04
8.2.100.0090.00317.84
8.2.90.0060.00318.03
8.2.80.0080.00018.05
8.2.70.0030.00518.05
8.2.60.0050.00318.28
8.2.50.0030.00618.34
8.2.40.0050.00320.77
8.2.30.0050.00319.54
8.2.20.0050.00318.14
8.2.10.0040.00418.31
8.2.00.0000.00818.23
8.1.330.0120.00722.22
8.1.320.0100.00916.45
8.1.310.0050.00316.68
8.1.300.0000.00817.95
8.1.290.0090.00030.84
8.1.280.0070.01125.92
8.1.270.0040.00422.23
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.96
8.1.230.0070.00422.73
8.1.220.0000.01017.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.35
8.1.180.0080.00018.10
8.1.170.0080.00018.71
8.1.160.0040.00418.99
8.1.150.0000.00720.39
8.1.140.0040.00419.54
8.1.130.0030.00319.12
8.1.120.0000.00717.48
8.1.110.0040.00417.50
8.1.100.0040.00417.47
8.1.90.0050.00217.52
8.1.80.0040.00417.57
8.1.70.0030.00317.63
8.1.60.0040.00417.68
8.1.50.0040.00417.52
8.1.40.0060.00317.53
8.1.30.0040.00417.72
8.1.20.0090.00017.72
8.1.10.0040.00417.59
8.1.00.0040.00417.48
8.0.300.0030.00619.77
8.0.290.0000.00816.88
8.0.280.0040.00418.48
8.0.270.0100.00017.40
8.0.260.0030.00316.95
8.0.250.0000.00817.02
8.0.240.0070.00417.15
8.0.230.0050.00317.13
8.0.220.0040.00416.91
8.0.210.0040.00417.02
8.0.200.0070.00017.13
8.0.190.0040.00417.07
8.0.180.0040.00417.00
8.0.170.0030.00617.07
8.0.160.0050.00317.04
8.0.150.0060.00316.88
8.0.140.0020.00516.84
8.0.130.0060.00013.46
8.0.120.0000.00816.92
8.0.110.0090.00017.04
8.0.100.0000.00716.90
8.0.90.0050.00317.04
8.0.80.0030.01917.07
8.0.70.0080.00016.96
8.0.60.0000.00717.00
8.0.50.0040.00417.02
8.0.30.0090.01017.17
8.0.20.0160.00917.40
8.0.10.0000.00717.14
8.0.00.0110.00716.91
7.4.330.0080.00015.55
7.4.320.0060.00016.72
7.4.300.0000.00716.67
7.4.290.0090.00016.50
7.4.280.0000.00916.73
7.4.270.0040.00416.49
7.4.260.0030.00616.71
7.4.250.0000.00716.59
7.4.240.0000.00716.60
7.4.230.0030.00316.54
7.4.220.0040.00416.72
7.4.210.0120.00916.64
7.4.200.0060.00316.53
7.4.160.0080.00816.58
7.4.140.0060.01217.86
7.4.130.0060.01216.54
7.4.120.0100.00816.56
7.4.110.0100.00716.51
7.4.100.0150.00416.63
7.4.90.0120.00616.69
7.4.80.0080.01419.39
7.4.70.0060.01216.47
7.4.60.0060.01016.53
7.4.50.0000.01016.20
7.4.40.0040.01416.61
7.4.10.0040.01514.75
7.4.00.0110.00715.04
7.3.330.0000.00513.30
7.3.320.0000.00513.36
7.3.310.0070.00016.47
7.3.300.0070.00016.29
7.3.290.0070.01116.40
7.3.280.0050.01116.50
7.3.260.0100.01016.48
7.3.240.0080.01116.52
7.3.230.0140.00616.48
7.3.210.0090.00916.42
7.3.200.0130.00316.78
7.3.190.0130.00316.44
7.3.180.0110.00516.40
7.3.170.0120.00616.44
7.3.160.0100.00916.69
7.3.130.0070.01314.95
7.3.120.0130.00314.77
7.3.110.0070.01414.47
7.3.100.0100.00715.00
7.3.90.0060.01014.91
7.3.80.0030.01314.95
7.3.70.0070.00714.56
7.3.60.0090.00314.91
7.3.50.0070.00714.90
7.3.40.0030.01014.79
7.3.30.0120.00014.77
7.3.20.0070.00716.79
7.3.10.0060.00316.86
7.3.00.0060.01016.68
7.2.330.0000.02316.87
7.2.320.0070.01116.95
7.2.310.0090.00616.99
7.2.300.0130.00316.60
7.2.290.0090.00916.67
7.2.260.0070.01015.01
7.2.250.0030.01615.11
7.2.240.0030.00915.08
7.2.230.0090.00915.08
7.2.220.0130.00314.99
7.2.210.0100.00315.07
7.2.200.0030.01015.31
7.2.190.0040.01115.03
7.2.180.0070.00615.23
7.2.170.0060.00915.09
7.2.160.0070.01015.22
7.2.150.0040.00816.71
7.2.140.0030.01316.82
7.2.130.0030.00716.72
7.2.120.0000.01517.06
7.2.110.0100.00716.72
7.2.100.0070.01117.00
7.2.90.0060.00917.04
7.2.80.0110.00416.90
7.2.70.0040.01116.92
7.2.60.0020.01316.88
7.2.50.0070.00416.78
7.2.40.0120.00616.89
7.2.30.0080.01017.53
7.2.20.0110.01217.51
7.2.10.0060.01517.51
7.2.00.0130.01017.41
7.1.330.0040.00815.42
7.1.320.0070.01015.82
7.1.310.0060.00915.60
7.1.300.0040.01115.74
7.1.290.0060.00915.66
7.1.280.0030.01015.86
7.1.270.0060.00915.78
7.1.260.0000.01115.89
7.1.250.0000.01415.86
7.1.240.0060.00915.48
7.1.230.0030.01315.69
7.1.220.0000.01715.85
7.1.210.0030.01115.96
7.1.200.0050.00915.86
7.1.190.0040.01115.57
7.1.180.0070.01015.66
7.1.170.0120.00315.66
7.1.160.0090.00615.59
7.1.150.0090.01116.37
7.1.140.0140.01016.27
7.1.130.0120.00816.46
7.1.120.0110.01016.14
7.1.110.0110.00815.90
7.1.100.0100.01016.00
7.1.90.0120.00615.91
7.1.80.0080.00816.02
7.1.70.0120.00915.68
7.1.60.0160.01024.55
7.1.50.0170.00924.45
7.1.40.0160.01424.25
7.1.30.0230.01224.30
7.1.20.0230.01424.28
7.1.10.0080.00815.40
7.1.00.0090.00815.33
7.0.330.0040.01115.32
7.0.320.0060.00915.40
7.0.310.0090.00615.30
7.0.300.0100.00715.42
7.0.290.0070.00715.24
7.0.280.0090.00315.11
7.0.270.0060.00315.28
7.0.260.0070.00715.44
7.0.250.0090.00615.21
7.0.240.0040.01215.52
7.0.230.0040.00815.55
7.0.220.0060.00615.16
7.0.210.0070.00715.30
7.0.200.0060.00315.41
7.0.190.0030.01015.32
7.0.180.0040.00715.32
7.0.170.0100.00615.17
7.0.160.0070.01115.53
7.0.150.0060.00615.41
7.0.140.0030.01015.55
7.0.130.0000.01415.55
7.0.120.0070.01015.54
7.0.110.0040.01115.46
7.0.100.0000.01015.60
7.0.90.0060.00615.37
7.0.80.0070.00315.29
7.0.70.0070.00715.34
7.0.60.0030.01015.48
7.0.50.0070.00715.25
7.0.40.0070.00713.52
7.0.30.0060.00613.56
7.0.20.0030.01013.57
7.0.10.0070.00713.21
7.0.00.0060.01013.58
5.6.400.0140.00014.38
5.6.390.0000.01014.17
5.6.380.0110.00014.09
5.6.370.0050.00514.32
5.6.360.0060.00314.26
5.6.350.0030.01014.43
5.6.340.0140.00014.14
5.6.330.0070.00714.40
5.6.320.0040.01114.30
5.6.310.0000.01014.14
5.6.300.0030.00814.39
5.6.290.0080.00414.05
5.6.280.0070.00714.13
5.6.270.0030.00913.86
5.6.260.0100.00314.38
5.6.250.0110.00414.46
5.6.240.0050.00514.39
5.6.230.0060.00613.95
5.6.220.0040.01114.20
5.6.210.0060.00614.01
5.6.200.0030.01714.08
5.6.190.0100.01014.08
5.6.180.0070.00314.23
5.6.170.0110.00413.89
5.6.160.0110.00713.86
5.6.150.0040.00814.11
5.6.140.0040.01214.03
5.6.130.0070.01014.12
5.6.120.0070.01013.89
5.6.110.0030.01314.31
5.6.100.0070.01114.24
5.6.90.0100.00314.10
5.6.80.0090.00613.98
5.6.70.0060.00914.07
5.6.60.0110.00414.17
5.6.50.0050.00914.05
5.6.40.0060.00613.98
5.6.30.0100.00313.93
5.6.20.0040.00813.99
5.6.10.0040.00714.29
5.6.00.0060.00613.94

preferences:
31.28 ms | 403 KiB | 5 Q