3v4l.org

run code in 300+ PHP versions simultaneously
<?php function facdef($n) { switch($n) { case 0: return 1; case 1: return 1; case 2: return 2; case 3: return 6; case 4: return 24; case 5: return 120; case 6: return 720; case 7: return 5040; case 8: return 40320; case 9: return 362880; case 10: return 3628800; case 11: return 39916800; case 12: return 479001600; case 13: return 6227020800; case 14: return 87178291200; case 15: return 1307674368000; case 16: return 20922789888000; case 17: return 355687428096000; case 18: return 6402373705728000; case 19: return 121645100408832000; case 20: return 2432902008176640000; case 21: return 51090942171709440000; case 22: return 1124000727777607680000; case 23: return 25852016738884976640000; } } function constify($a) { #regression constants return $a*0.424+0.548; } function scorefix($avg) { #if predicted score is small or negative, return something reasonable if ( $avg < 0.01 ) { return 10^(10^$avg-1) / 105.50984676065602; } else { return $avg; } } function sim($homeoff,$homedef,$awayoff,$awaydef,$mul,$natavg) { #returns homemu,awaymu for poisson to deal with return array(scorefix((($homeoff-$natavg)*max(constify($awaydef*$mul),0.25)/constify($natavg*$mul)+$awaydef)*$mul),scorefix((($homedef-$natavg)*max(constify($awayoff/$mul),0.25)/constify($natavg/$mul)+$awayoff)/$mul)); } function poisson($mu,$shift) { #returns array of poisson probabilities for scores $x = []; for ($i = 1 ; $i <= $shift ; $i++ ) { array_push($x,0.0); } $pcdf = 0.0; $a = exp(-1*$mu); echo count($a); while ( $pcdf < 0.999999 || count($x) < 5 ) { echo $mu^(count($x)-$shift)."\n"; echo facdef(count($x)-$shift)."\n"; array_push($x,$a*($mu^(count($x)-$shift))/facdef(count($x)-$shift)); echo count($x); $pcdf+=end($x); } return $x; } var_dump(poisson(1.1,0)); ?>

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.0180.00417.13
8.3.50.0140.00522.02
8.3.40.0090.00619.03
8.3.30.0120.00319.09
8.3.20.0040.00420.43
8.3.10.0110.00723.80
8.3.00.0110.00019.50
8.2.180.0150.00616.88
8.2.170.0070.00722.96
8.2.160.0150.00020.59
8.2.150.0090.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00420.82
8.2.120.0070.00026.35
8.2.110.0100.00021.31
8.2.100.0120.00017.88
8.2.90.0000.00819.47
8.2.80.0040.00417.97
8.2.70.0040.00418.00
8.2.60.0080.00018.05
8.2.50.0000.00818.07
8.2.40.0000.00921.23
8.2.30.0000.00720.94
8.2.20.0030.00617.88
8.2.10.0000.00718.34
8.2.00.0030.00618.42
8.1.280.0120.00425.92
8.1.270.0070.00724.13
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0110.00022.72
8.1.230.0040.00718.04
8.1.220.0030.00618.04
8.1.210.0040.00418.77
8.1.200.0060.00617.59
8.1.190.0040.00418.07
8.1.180.0040.00418.10
8.1.170.0040.00418.97
8.1.160.0050.00222.28
8.1.150.0040.00419.15
8.1.140.0030.00519.84
8.1.130.0000.00717.95
8.1.120.0040.00417.63
8.1.110.0050.00317.70
8.1.100.0000.00717.62
8.1.90.0050.00217.75
8.1.80.0030.00317.74
8.1.70.0030.00317.67
8.1.60.0070.00417.87
8.1.50.0050.00317.81
8.1.40.0040.00417.71
8.1.30.0000.00817.88
8.1.20.0040.00417.87
8.1.10.0000.00817.74
8.1.00.0040.00417.81
8.0.300.0080.00018.77
8.0.290.0070.00017.00
8.0.280.0050.00318.75
8.0.270.0030.00317.39
8.0.260.0000.00717.51
8.0.250.0030.00317.29
8.0.240.0030.00317.21
8.0.230.0000.00817.12
8.0.220.0050.00217.03
8.0.210.0040.00417.09
8.0.200.0030.00317.19
8.0.190.0090.00017.22
8.0.180.0030.00517.23
8.0.170.0050.00317.25
8.0.160.0000.00717.11
8.0.150.0040.00417.11
8.0.140.0030.00517.09
8.0.130.0000.00513.64
8.0.120.0000.00817.21
8.0.110.0070.00017.22
8.0.100.0040.00417.28
8.0.90.0050.00317.09
8.0.80.0070.00717.09
8.0.70.0000.00817.18
8.0.60.0000.00717.11
8.0.50.0040.00417.24
8.0.30.0100.00917.27
8.0.20.0110.00817.49
8.0.10.0070.00017.32
8.0.00.0080.01016.95
7.4.330.0050.00016.97
7.4.320.0040.00416.75
7.4.300.0030.00316.77
7.4.290.0030.00316.77
7.4.280.0090.00016.85
7.4.270.0000.00716.86
7.4.260.0060.00316.74
7.4.250.0040.00416.75
7.4.240.0020.00516.89
7.4.230.0070.00016.94
7.4.220.0090.01516.74
7.4.210.0090.00716.84
7.4.200.0080.00016.86
7.4.160.0120.00416.75
7.4.150.0130.00617.40
7.4.140.0120.00717.86
7.4.130.0100.00816.71
7.4.120.0070.01116.73
7.4.110.0130.01316.79
7.4.100.0040.01816.64
7.4.90.0150.00316.86
7.4.80.0090.01519.39
7.4.70.0110.00616.64
7.4.60.0070.01416.67
7.4.50.0060.00616.96
7.4.40.0110.00516.93
7.4.30.0130.00916.71
7.4.10.0050.01216.21
7.4.00.0060.01115.73
7.3.330.0000.00513.44
7.3.320.0000.00513.45
7.3.310.0080.00016.68
7.3.300.0040.00416.52
7.3.290.0110.00416.49
7.3.280.0110.00616.50
7.3.270.0140.01417.40
7.3.260.0080.01216.60
7.3.250.0090.01116.70
7.3.240.0130.00516.69
7.3.230.0170.00716.56
7.3.210.0160.00316.70
7.3.200.0080.01116.50
7.3.190.0030.01916.52
7.3.180.0130.01016.50
7.3.170.0130.00616.55
7.3.160.0170.00816.72
7.3.130.0040.01316.11
7.3.120.0070.01015.90
7.3.110.0060.01015.82
7.3.100.0090.00715.74
7.3.90.0040.00815.79
7.3.80.0060.00715.92
7.3.70.0050.00715.77
7.3.60.0020.01015.80
7.3.50.0050.00715.57
7.3.40.0100.00315.74
7.3.30.0040.01015.70
7.3.20.0050.01017.60
7.3.10.0050.00617.54
7.3.00.0090.00717.54
7.2.330.0110.00716.97
7.2.320.0070.01016.94
7.2.310.0100.00716.98
7.2.300.0110.00716.75
7.2.290.0030.01417.04
7.2.260.0080.01316.17
7.2.250.0080.01116.10
7.2.240.0070.00916.07
7.2.230.0040.00916.05
7.2.220.0090.00515.98
7.2.210.0040.00915.97
7.2.200.0050.00816.08
7.2.190.0050.01215.95
7.2.180.0050.00716.07
7.2.170.0010.01216.00
7.2.160.0060.00915.96
7.2.150.0060.01117.73
7.2.140.0060.00917.79
7.2.130.0080.00517.77
7.2.120.0060.01117.90
7.2.110.0080.00817.75
7.2.100.0050.00717.87
7.2.90.0040.01217.80
7.2.80.0140.00517.66
7.2.70.0070.00717.89
7.2.60.0050.00817.63
7.2.50.0020.00917.66
7.2.40.0040.01117.79
7.2.30.0080.00717.78
7.2.20.0060.01017.79
7.2.10.0060.01017.83
7.2.00.0050.00918.36
7.1.330.0070.00816.67
7.1.320.0090.00516.65
7.1.310.0020.01116.56
7.1.300.0050.00816.50
7.1.290.0040.00816.67
7.1.280.0070.00616.63
7.1.270.0040.00916.54
7.1.260.0040.00716.67
7.1.250.0050.00916.57
7.1.240.0040.01016.79
7.1.230.0050.00716.68
7.1.220.0080.00416.70
7.1.210.0020.01016.77
7.1.200.0060.00616.40
7.1.190.0070.00616.63
7.1.180.0020.01116.65
7.1.170.0070.00616.71
7.1.160.0070.00916.78
7.1.150.0060.01116.67
7.1.140.0050.01016.65
7.1.130.0080.00516.75
7.1.120.0070.00516.72
7.1.110.0070.00416.72
7.1.100.0060.00616.67
7.1.90.0040.00716.61
7.1.80.0020.00916.70
7.1.70.0060.00716.87
7.1.60.0030.01116.96
7.1.50.0050.01016.88
7.1.40.0100.00216.61
7.1.30.0060.00816.73
7.1.20.0030.00916.54
7.1.10.0060.00516.69
7.1.00.0060.02518.20
7.0.330.0040.01016.28
7.0.320.0050.00716.35
7.0.310.0050.00616.27
7.0.300.0060.00616.28
7.0.290.0030.01216.38
7.0.280.0090.00616.33
7.0.270.0040.00916.26
7.0.260.0100.00516.27
7.0.250.0020.01116.41
7.0.240.0030.00816.39
7.0.230.0050.00816.49
7.0.220.0040.00816.48
7.0.210.0090.00616.29
7.0.200.0040.00816.58
7.0.190.0050.00916.31
7.0.180.0070.00716.23
7.0.170.0080.00716.33
7.0.160.0050.00616.41
7.0.150.0040.00916.27
7.0.140.0080.00516.37
7.0.130.0070.00616.25
7.0.120.0070.00516.36
7.0.110.0050.00816.29
7.0.100.0060.00716.25
7.0.90.0050.01016.34
7.0.80.0050.00516.33
7.0.70.0060.00816.32
7.0.60.0030.02217.27
7.0.50.0070.01916.81
7.0.40.0080.02415.85
7.0.30.0100.01615.90
7.0.20.0110.02115.78
7.0.10.0080.02615.86
7.0.00.0090.02515.85
5.6.400.0020.01115.18
5.6.390.0020.01315.17
5.6.380.0050.00815.25
5.6.370.0040.00715.36
5.6.360.0050.00715.45
5.6.350.0040.01115.45
5.6.340.0050.01015.11
5.6.330.0060.00815.38
5.6.320.0060.00715.35
5.6.310.0040.00915.52
5.6.300.0070.00615.40
5.6.290.0030.01115.18
5.6.280.0050.02016.73
5.6.270.0030.00915.40
5.6.260.0070.00715.37
5.6.250.0060.00815.32
5.6.240.0030.01015.39
5.6.230.0070.00815.21
5.6.220.0040.00915.40
5.6.210.0070.02516.66
5.6.200.0090.02116.05
5.6.190.0060.01716.54
5.6.180.0180.02516.68
5.6.170.0100.01616.61
5.6.160.0080.01516.65
5.6.150.0060.02116.17
5.6.140.0040.01916.02
5.6.130.0030.01816.02
5.6.120.0040.01916.80
5.6.110.0090.01916.87
5.6.100.0060.02916.69
5.6.90.0030.02616.71
5.6.80.0060.02516.58
5.6.70.0040.00815.30
5.6.60.0060.00615.28
5.6.50.0060.00715.04
5.6.40.0070.00715.27
5.6.30.0030.01115.23
5.6.20.0080.00615.11
5.6.10.0070.00715.13
5.6.00.0060.00815.18
5.5.380.0060.00515.22
5.5.370.0040.00815.26
5.5.360.0060.00815.37
5.5.350.0110.02616.61
5.5.340.0050.02816.01
5.5.330.0080.02016.59
5.5.320.0060.01816.56
5.5.310.0080.01716.60
5.5.300.0080.01816.08
5.5.290.0070.02115.96
5.5.280.0060.02416.73
5.5.270.0030.02816.71
5.5.260.0050.02416.84
5.5.250.0040.02816.76
5.5.240.0060.02816.46
5.5.230.0050.00715.29
5.5.220.0080.00515.12
5.5.210.0040.00915.21
5.5.200.0070.00415.15
5.5.190.0070.00515.30
5.5.180.0040.01115.18
5.5.170.0060.00915.09
5.5.160.0080.00815.15
5.5.150.0070.00615.34
5.5.140.0060.01015.12
5.5.130.0090.00715.16
5.5.120.0080.00715.20
5.5.110.0060.01115.17
5.5.100.0080.01015.21
5.5.90.0030.00915.26
5.5.80.0080.00615.08
5.5.70.0070.00615.13
5.5.60.0050.01015.21
5.5.50.0090.00615.07
5.5.40.0050.00915.19
5.5.30.0080.00715.20
5.5.20.0040.00715.07
5.5.10.0070.01015.19
5.5.00.0030.01115.10

preferences:
54.87 ms | 401 KiB | 5 Q