3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** results in hhvm differ from php's **/ function main($year, $limit) { $PERIOD = 0.080905722906849315068493150684932; $PERIOD_HALF = 0.040452861453424657534246575342; //printf("PERIOD : %.33f\n", $PERIOD); //printf("PERIOD_HALF: %.33f\n", $PERIOD_HALF); $old = 0; do { $year += $PERIOD; $jde = calc($year, 0.0); if ($old != 0) { $diff = $jde - $old; if ($diff > 40) { $year2 = $year - $PERIOD_HALF; $jde2 = calc($year2, 0.0); $jde2 = calc($year2, 0.5); } } $jde = calc($year, 0.5); $old = $jde; } while ($year <= $limit); } function calc($year, $phase) { $k = floor(($year - 2000) * 12.3685); $k += $phase; $T = $k / 1236.85; $jde = 2451550.09766 + 29.530588861 * $k + (0.00015437 + (-0.000000150 + 0.00000000073 * $T) * $T) * $T * $T; //Print by changing %.12f from %.1f ~ %12.f or more //It's not the problem of printf/sprintf. But it's much more about arithmetic calculation. printf("%.10f %.1f %.1f\n", $jde, $k, $phase); } /**********************************************/ $year = 2014; $limit = 2015; main($year, $limit); ?>

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.0130.00718.56
8.3.50.0290.00222.93
8.3.40.0120.00318.93
8.3.30.0040.01119.27
8.3.20.0040.00420.41
8.3.10.0080.00021.94
8.3.00.0060.00319.79
8.2.180.0090.00916.50
8.2.170.0170.00322.96
8.2.160.0120.00318.72
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0040.00420.85
8.2.110.0070.01420.71
8.2.100.0110.00018.03
8.2.90.0000.00819.34
8.2.80.0090.00017.97
8.2.70.0080.00017.75
8.2.60.0030.00718.05
8.2.50.0000.00918.07
8.2.40.0040.00418.16
8.2.30.0070.00018.07
8.2.20.0050.00317.86
8.2.10.0000.00818.07
8.2.00.0000.00917.80
8.1.280.0070.01425.92
8.1.270.0050.00323.87
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0070.00323.85
8.1.230.0110.00020.86
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0040.00417.48
8.1.190.0040.00417.13
8.1.180.0030.00618.10
8.1.170.0000.00818.54
8.1.160.0040.00422.08
8.1.150.0040.00418.87
8.1.140.0040.00417.50
8.1.130.0030.00317.94
8.1.120.0070.00017.51
8.1.110.0040.00417.57
8.1.100.0040.00417.53
8.1.90.0030.00417.50
8.1.80.0040.00417.51
8.1.70.0000.00717.50
8.1.60.0040.00417.53
8.1.50.0030.00517.55
8.1.40.0030.00517.61
8.1.30.0040.00417.62
8.1.20.0080.00017.67
8.1.10.0080.00017.57
8.1.00.0000.00717.51
8.0.300.0030.00618.77
8.0.290.0000.00716.75
8.0.280.0000.00818.39
8.0.270.0050.00217.35
8.0.260.0000.00717.18
8.0.250.0030.00317.06
8.0.240.0000.00817.02
8.0.230.0070.00017.09
8.0.220.0030.00316.96
8.0.210.0020.00516.96
8.0.200.0070.00016.89
8.0.190.0040.00417.04
8.0.180.0060.00316.93
8.0.170.0000.00817.04
8.0.160.0030.00516.98
8.0.150.0030.00417.00
8.0.140.0070.00016.98
8.0.130.0000.00513.45
8.0.120.0060.00316.97
8.0.110.0000.00717.01
8.0.100.0030.00616.82
8.0.90.0040.00417.02
8.0.80.0080.00817.00
8.0.70.0040.00417.00
8.0.60.0000.00716.88
8.0.50.0000.00816.82
8.0.30.0140.00817.02
8.0.20.0160.00617.40
8.0.10.0070.00017.06
8.0.00.0100.01216.72
7.4.330.0000.00615.10
7.4.320.0030.00316.67
7.4.300.0000.00616.66
7.4.290.0040.00416.66
7.4.280.0040.00416.69
7.4.270.0070.00016.72
7.4.260.0110.00016.66
7.4.250.0000.00816.64
7.4.240.0060.00116.65
7.4.230.0030.00316.57
7.4.220.0090.00916.64
7.4.210.0100.01016.70
7.4.200.0030.00316.68
7.4.160.0100.00716.68
7.4.150.0150.00917.40
7.4.140.0180.01617.86
7.4.130.0120.00616.67
7.4.120.0080.00916.69
7.4.110.0140.00416.69
7.4.100.0090.00916.59
7.4.90.0120.00616.68
7.4.80.0100.01319.39
7.4.70.0060.00916.50
7.4.60.0110.00716.49
7.4.50.0030.00616.54
7.4.40.0120.00916.54
7.4.30.0070.01016.57
7.4.00.0050.00714.92
7.3.330.0000.00613.43
7.3.320.0030.00313.45
7.3.310.0050.00216.48
7.3.300.0050.00216.36
7.3.290.0070.01416.49
7.3.280.0100.00916.46
7.3.270.0060.01217.40
7.3.260.0160.01016.81
7.3.240.0070.01416.44
7.3.230.0090.00916.48
7.3.210.0110.00616.46
7.3.200.0140.00719.39
7.3.190.0030.01316.48
7.3.180.0090.01216.70
7.3.170.0070.01016.48
7.3.160.0110.00816.47
7.3.120.0070.01114.84
7.3.110.0130.00314.88
7.3.100.0070.01114.77
7.3.90.0130.00014.73
7.3.80.0060.01314.74
7.3.70.0090.00615.05
7.3.60.0060.00614.85
7.3.50.0040.01114.87
7.3.40.0030.01014.63
7.3.30.0060.01014.89
7.3.20.0040.01116.72
7.3.10.0070.00716.46
7.3.00.0100.00316.73
7.2.330.0150.00316.78
7.2.320.0070.01116.80
7.2.310.0070.01016.59
7.2.300.0130.00416.64
7.2.290.0070.01016.71
7.2.250.0100.01014.79
7.2.240.0090.00914.91
7.2.230.0000.01414.65
7.2.220.0090.00914.96
7.2.210.0070.01415.06
7.2.200.0040.00915.04
7.2.190.0120.00815.03
7.2.180.0040.01215.02
7.2.170.0070.01015.05
7.2.160.0030.01015.11
7.2.150.0060.00616.89
7.2.140.0070.01016.89
7.2.130.0040.00816.82
7.2.120.0100.00316.85
7.2.110.0030.01316.96
7.2.100.0090.00616.88
7.2.90.0130.00316.57
7.2.80.0130.00316.95
7.2.70.0030.01016.64
7.2.60.0040.00716.95
7.2.50.0080.00416.92
7.2.40.0030.01216.65
7.2.30.0030.00917.08
7.2.20.0120.00316.97
7.2.10.0060.00916.91
7.2.00.0100.00617.91
7.1.330.0070.01015.83
7.1.320.0030.01315.97
7.1.310.0090.00315.73
7.1.300.0090.00615.68
7.1.290.0100.00315.79
7.1.280.0080.00315.84
7.1.270.0030.01015.86
7.1.260.0060.00615.79
7.1.250.0060.00615.91
7.1.240.0070.00715.76
7.1.230.0120.00315.61
7.1.220.0100.00315.98
7.1.210.0030.01015.71
7.1.200.0040.00715.92
7.1.190.0040.00715.71
7.1.180.0060.00615.96
7.1.170.0070.00715.97
7.1.160.0000.01315.91
7.1.150.0060.00615.82
7.1.140.0070.00715.83
7.1.130.0090.00615.86
7.1.120.0000.00815.82
7.1.110.0040.00815.80
7.1.100.0160.00216.47
7.1.90.0040.01116.02
7.1.80.0100.00315.81
7.1.70.0040.00816.54
7.1.60.0140.00317.60
7.1.50.0060.01316.46
7.1.40.0090.00615.69
7.1.30.0070.00715.87
7.1.20.0090.00915.56
7.1.10.0030.01315.63
7.1.00.0020.04419.17
7.0.330.0060.00615.18
7.0.320.0080.00315.52
7.0.310.0000.01515.38
7.0.300.0070.00715.46
7.0.290.0060.00315.42
7.0.280.0040.00715.49
7.0.270.0100.00015.16
7.0.260.0040.00715.38
7.0.250.0040.00815.28
7.0.240.0040.01115.28
7.0.230.0070.00715.52
7.0.220.0100.00715.55
7.0.210.0000.01715.58
7.0.200.0030.00616.02
7.0.190.0060.00315.52
7.0.180.0000.01415.37
7.0.170.0060.00915.59
7.0.160.0090.00915.29
7.0.150.0030.01415.43
7.0.140.0050.03618.77
7.0.130.0030.01015.24
7.0.120.0110.00315.48
7.0.110.0110.00415.57
7.0.100.0100.04317.55
7.0.90.0110.03817.57
7.0.80.0080.04317.58
7.0.70.0100.04417.70
7.0.60.0070.04317.74
7.0.50.0120.04617.80
7.0.40.0050.04916.84
7.0.30.0110.04416.85
7.0.20.0090.04216.75
7.0.10.0100.04016.70
7.0.00.0100.03116.68
5.6.400.0050.00514.59
5.6.390.0080.00614.60
5.6.380.0060.00914.37
5.6.370.0000.00914.67
5.6.360.0060.01014.48
5.6.350.0060.00614.28
5.6.340.0070.00314.09
5.6.330.0090.00614.54
5.6.320.0030.00614.32
5.6.310.0120.00314.24
5.6.300.0070.00714.38
5.6.290.0000.01314.21
5.6.280.0030.04517.72
5.6.270.0110.00714.55
5.6.260.0090.00613.98
5.6.250.0040.04717.62
5.6.240.0070.04317.46
5.6.230.0080.04317.53
5.6.220.0110.03217.51
5.6.210.0070.03817.50
5.6.200.0080.02817.77
5.6.190.0100.04217.67
5.6.180.0090.03217.77
5.6.170.0080.04517.67
5.6.160.0100.04017.69
5.6.150.0060.04317.73
5.6.140.0050.03817.60
5.6.130.0130.02617.63
5.6.120.0080.04517.71
5.6.110.0110.02417.80
5.6.100.0090.04217.63
5.6.90.0100.03817.66
5.6.80.0070.04417.42
5.6.70.0090.04417.42
5.6.60.0090.03717.32
5.6.50.0050.04317.32
5.6.40.0070.04517.44
5.6.30.0060.03717.36
5.6.20.0060.02817.35
5.6.10.0100.03717.38
5.6.00.0070.04317.25
5.5.380.0100.03217.40
5.5.370.0030.04917.39
5.5.360.0100.04517.26
5.5.350.0080.04717.36
5.5.340.0080.04317.61
5.5.330.0130.04017.55
5.5.320.0050.05117.68
5.5.310.0050.04217.62
5.5.300.0070.03817.47
5.5.290.0100.04517.55
5.5.280.0100.02517.79
5.5.270.0050.04617.61
5.5.260.0050.04317.42
5.5.250.0030.04417.32
5.5.240.0170.03317.33
5.5.230.0080.02517.16
5.5.220.0080.04217.08
5.5.210.0020.03117.00
5.5.200.0110.03817.28
5.5.190.0070.04717.21
5.5.180.0120.03517.18
5.5.170.0060.00614.24
5.5.160.0050.04517.16
5.5.150.0050.04517.22
5.5.140.0130.03317.20
5.5.130.0100.04017.11
5.5.120.0080.03817.25
5.5.110.0100.03517.21
5.5.100.0030.04417.06
5.5.90.0070.04217.23
5.5.80.0150.03517.07
5.5.70.0050.03717.13
5.5.60.0000.04617.12
5.5.50.0100.03617.23
5.5.40.0060.04417.24
5.5.30.0020.04717.17
5.5.20.0120.04217.13
5.5.10.0100.04017.20
5.5.00.0020.04717.00
5.4.450.0110.03815.86
5.4.440.0070.03615.83
5.4.430.0050.04115.70
5.4.420.0020.04515.70
5.4.410.0060.04015.78
5.4.400.0050.03915.63
5.4.390.0100.02715.62
5.4.380.0030.04515.67
5.4.370.0080.03715.64
5.4.360.0110.02315.62
5.4.350.0070.03615.67
5.4.340.0070.04315.54
5.4.330.0030.01012.20
5.4.320.0080.04015.69
5.4.310.0080.04015.54
5.4.300.0100.03515.61
5.4.290.0090.03415.69
5.4.280.0050.04015.60
5.4.270.0050.02215.68
5.4.260.0070.04115.57
5.4.250.0080.03715.64
5.4.240.0070.04415.68
5.4.230.0030.03515.71
5.4.220.0080.03215.57
5.4.210.0070.03715.69
5.4.200.0060.04115.64
5.4.190.0120.03615.62
5.4.180.0050.04415.54
5.4.170.0030.02315.53
5.4.160.0100.03515.57
5.4.150.0070.03915.61
5.4.140.0030.04114.32
5.4.130.0020.04014.27
5.4.120.0110.03714.32
5.4.110.0030.03914.37
5.4.100.0060.03514.36
5.4.90.0050.03614.39
5.4.80.0040.03614.29
5.4.70.0090.03014.29
5.4.60.0030.03414.35
5.4.50.0070.03314.34
5.4.40.0070.04014.29
5.4.30.0070.03714.28
5.4.20.0030.04414.32
5.4.10.0060.04114.30
5.4.00.0000.02914.00
5.3.290.0060.04013.40
5.3.280.0060.03513.39
5.3.270.0080.03713.48
5.3.260.0030.04513.44
5.3.250.0050.04113.40
5.3.240.0090.03413.39
5.3.230.0090.03713.39
5.3.220.0050.04113.46
5.3.210.0050.02013.45
5.3.200.0030.03713.44
5.3.190.0070.04213.39
5.3.180.0040.03713.35
5.3.170.0070.03813.43
5.3.160.0000.04613.37
5.3.150.0100.03513.37
5.3.140.0050.03213.41
5.3.130.0070.03813.37
5.3.120.0020.04613.43
5.3.110.0020.04213.41
5.3.100.0070.03413.19
5.3.90.0050.03813.17
5.3.80.0090.03613.13
5.3.70.0070.03813.16
5.3.60.0030.04313.07
5.3.50.0080.03213.08
5.3.40.0030.03813.03
5.3.30.0030.04413.07
5.3.20.0050.04112.96
5.3.10.0060.03612.88
5.3.00.0060.03012.88
5.2.170.0030.06311.25
5.2.160.0030.06311.01
5.2.150.0070.06311.22
5.2.140.0070.06311.29
5.2.130.0030.04310.97
5.2.120.0130.05311.13
5.2.110.0030.06011.13
5.2.100.0070.05711.24
5.2.90.0130.05311.17
5.2.80.0130.05711.21
5.2.70.0100.04010.96
5.2.60.0100.05710.99
5.2.50.0130.05011.16
5.2.40.0000.05711.07
5.2.30.0130.05311.02
5.2.20.0030.05711.03
5.2.10.0000.06310.90
5.2.00.0030.03710.76
5.1.60.0030.0579.89
5.1.50.0100.05010.08
5.1.40.0100.0539.93
5.1.30.0030.06010.37
5.1.20.0030.04710.45
5.1.10.0030.0539.98
5.1.00.0070.03710.23
5.0.50.0030.0478.57
5.0.40.0070.0408.52
5.0.30.0070.0678.41
5.0.20.0130.0378.41
5.0.10.0030.0478.41
5.0.00.0030.0608.41
4.4.90.0070.0338.41
4.4.80.0000.0408.41
4.4.70.0000.0378.41
4.4.60.0070.0308.41
4.4.50.0000.0378.41
4.4.40.0070.0408.41
4.4.30.0030.0338.41
4.4.20.0030.0378.41
4.4.10.0070.0308.41
4.4.00.0070.0508.41
4.3.110.0000.0278.41
4.3.100.0030.0278.41
4.3.90.0070.0308.41
4.3.80.0000.0408.41
4.3.70.0000.0378.41
4.3.60.0000.0378.41
4.3.50.0030.0338.41
4.3.40.0070.0478.41
4.3.30.0070.0338.41
4.3.20.0000.0338.41
4.3.10.0030.0338.41
4.3.00.0030.0338.41

preferences:
42.34 ms | 400 KiB | 5 Q