3v4l.org

run code in 300+ PHP versions simultaneously
<?php function solstice() { // Set timezone date_default_timezone_set('UTC'); $date='2014/01/01'; $end_date='2014/12/31'; $i = 0; //loop through the year while(strtotime($date)<=strtotime($end_date)) { $sunrise=date_sunrise(strtotime($date),SUNFUNCS_RET_DOUBLE,31.47,35.13,90,3); $sunset=date_sunset(strtotime($date),SUNFUNCS_RET_DOUBLE,31.47,35.13,90,3); //calculate time difference $delta = $sunset-$sunrise; //store the time difference $delta_array[$i] = $delta; //store the date $dates_array[$i] = $date; $i++; //next day $date=date("Y-m-d",strtotime("+1 day",strtotime($date))); } $shortest_key = array_search(min($delta_array), $delta_array); $longest_key = array_search(max($delta_array), $delta_array); echo "The longest day is:".$dates_array[$longest_key]. "<br />"; echo "The shortest day is:".$dates_array[$shortest_key]. "<br />"; } solstice();

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.0160.00317.25
8.3.50.0130.01322.15
8.3.40.0070.01519.42
8.3.30.0130.01319.65
8.3.20.0100.00020.79
8.3.10.0110.00024.06
8.3.00.0080.00618.00
8.2.180.0160.01319.04
8.2.170.0030.01722.96
8.2.160.0090.01221.02
8.2.150.0090.00324.18
8.2.140.0030.00724.66
8.2.130.0000.01026.16
8.2.120.0070.00322.62
8.2.110.0030.01022.54
8.2.100.0040.01118.60
8.2.90.0030.00718.91
8.2.80.0040.00719.77
8.2.70.0150.00018.13
8.2.60.0000.01218.55
8.2.50.0000.01218.60
8.2.40.0040.00718.77
8.2.30.0050.00518.59
8.2.20.0070.00418.45
8.2.10.0000.01018.64
8.2.00.0040.01118.51
8.1.280.0130.01725.92
8.1.270.0060.00624.43
8.1.260.0070.00326.35
8.1.250.0070.00428.09
8.1.240.0060.00624.48
8.1.230.0070.00723.16
8.1.220.0040.00718.50
8.1.210.0040.00719.41
8.1.200.0000.01518.13
8.1.190.0000.01217.91
8.1.180.0040.01119.76
8.1.170.0030.00919.20
8.1.160.0000.01122.63
8.1.150.0040.00719.34
8.1.140.0070.00718.28
8.1.130.0070.00318.56
8.1.120.0080.00818.20
8.1.110.0050.00518.22
8.1.100.0000.01118.21
8.1.90.0060.00618.17
8.1.80.0070.00318.11
8.1.70.0030.00718.16
8.1.60.0000.01218.33
8.1.50.0000.01118.05
8.1.40.0030.00918.26
8.1.30.0000.01118.29
8.1.20.0050.00518.14
8.1.10.0000.01118.17
8.1.00.0060.00618.17
8.0.300.0070.00322.59
8.0.290.0040.00717.66
8.0.280.0070.00319.05
8.0.270.0030.00717.87
8.0.260.0030.00717.75
8.0.250.0030.00617.77
8.0.240.0030.00617.59
8.0.230.0000.01017.69
8.0.220.0000.00917.65
8.0.210.0030.00617.49
8.0.200.0030.00617.71
8.0.190.0070.00317.69
8.0.180.0040.00917.64
8.0.170.0040.00717.64
8.0.160.0000.01017.68
8.0.150.0030.00717.60
8.0.140.0000.01017.59
8.0.130.0080.00314.06
8.0.120.0040.00717.49
8.0.110.0000.01017.52
8.0.100.0030.00717.72
8.0.90.0030.00717.52
8.0.80.0130.01717.36
8.0.70.0030.00717.56
8.0.60.0030.00717.71
8.0.50.0030.00717.46
8.0.30.0100.01517.56
8.0.20.0080.01517.58
8.0.10.0000.01117.77
8.0.00.0050.01717.31
7.4.330.0030.00515.46
7.4.320.0000.00917.16
7.4.300.0000.00917.28
7.4.290.0030.00617.20
7.4.280.0000.01117.16
7.4.270.0070.00317.30
7.4.260.0060.00317.27
7.4.250.0030.00717.11
7.4.240.0030.00717.15
7.4.230.0000.01017.09
7.4.220.0100.02117.06
7.4.210.0050.01517.11
7.4.200.0030.00717.27
7.4.190.0070.00417.34
7.4.160.0150.00616.95
7.4.150.0100.01417.40
7.4.140.0110.01617.86
7.4.130.0070.02016.99
7.4.120.0120.01017.07
7.4.110.0070.01717.02
7.4.100.0160.01317.17
7.4.90.0070.01417.15
7.4.80.0090.01919.39
7.4.70.0130.01617.20
7.4.60.0060.01517.13
7.4.50.0000.01217.00
7.4.40.0100.01022.77
7.4.30.0130.00817.17
7.4.10.0070.01715.79
7.4.00.0100.01315.89
7.3.330.0000.00913.89
7.3.320.0030.00913.95
7.3.310.0070.00417.09
7.3.300.0030.00616.88
7.3.290.0070.01816.90
7.3.280.0060.01616.97
7.3.270.0060.01617.40
7.3.260.0160.01417.13
7.3.250.0080.01417.07
7.3.240.0200.00917.14
7.3.230.0060.02117.12
7.3.210.0130.01317.18
7.3.200.0080.01819.39
7.3.190.0160.01316.99
7.3.180.0120.00916.92
7.3.170.0060.01517.07
7.3.160.0070.01417.16
7.3.130.0090.01516.12
7.3.120.0050.01615.86
7.3.110.0100.01615.52
7.3.100.0030.01515.91
7.3.90.0030.01716.02
7.3.80.0070.00715.86
7.3.70.0000.02115.79
7.3.60.0040.01415.91
7.3.50.0060.00615.92
7.3.40.0070.01315.76
7.3.30.0030.02015.81
7.3.20.0000.01517.72
7.3.10.0040.01417.70
7.3.00.0090.01217.48
7.2.330.0060.01617.15
7.2.320.0130.01017.26
7.2.310.0100.01017.18
7.2.300.0150.00617.00
7.2.290.0090.02217.02
7.2.260.0000.02516.03
7.2.250.0110.01416.34
7.2.240.0000.02116.02
7.2.230.0060.01315.96
7.2.220.0060.01916.23
7.2.210.0000.01416.02
7.2.200.0000.02116.11
7.2.190.0090.00915.82
7.2.180.0000.01515.89
7.2.170.0030.01315.88
7.2.160.0070.01315.77
7.2.150.0090.00917.68
7.2.140.0070.01417.68
7.2.130.0070.01717.91
7.2.120.0070.01617.70
7.2.110.0070.01217.67
7.2.100.0060.01317.75
7.2.90.0100.01017.59
7.2.80.0060.01617.72
7.2.70.0060.01217.56
7.2.60.0030.01717.85
7.2.50.0130.01317.86
7.2.40.0000.01717.55
7.2.30.0090.01217.88
7.2.20.0140.00717.88
7.2.10.0070.01317.86
7.2.00.0050.01318.97
7.1.330.0070.01316.65
7.1.320.0090.00916.61
7.1.310.0060.01216.45
7.1.300.0040.01416.72
7.1.290.0070.01116.49
7.1.280.0100.01316.86
7.1.270.0070.01316.80
7.1.260.0070.01016.64
7.1.250.0120.01216.48
7.1.240.0040.01516.46
7.1.230.0110.00716.71
7.1.220.0000.01816.80
7.1.210.0070.01016.75
7.1.200.0070.01416.71
7.1.190.0030.01316.80
7.1.180.0100.01016.51
7.1.170.0090.01516.78
7.1.160.0090.00616.74
7.1.150.0060.01216.54
7.1.140.0030.01616.45
7.1.130.0100.00716.59
7.1.120.0030.01716.47
7.1.110.0030.01216.51
7.1.100.0030.01317.78
7.1.90.0090.00916.63
7.1.80.0040.01216.51
7.1.70.0070.01217.20
7.1.60.0100.01218.13
7.1.50.0090.01417.22
7.1.40.0090.00916.52
7.1.30.0060.01316.71
7.1.20.0030.01316.80
7.1.10.0040.01516.73
7.1.00.0020.05119.73
7.0.330.0070.01416.18
7.0.320.0040.01416.19
7.0.310.0060.01316.40
7.0.300.0070.01716.19
7.0.290.0060.01316.09
7.0.280.0090.01216.29
7.0.270.0060.00916.21
7.0.260.0000.01216.29
7.0.250.0060.01216.02
7.0.240.0100.01016.29
7.0.230.0030.01316.46
7.0.220.0000.01416.14
7.0.210.0000.01216.30
7.0.200.0060.01016.79
7.0.190.0030.01916.13
7.0.180.0060.01216.35
7.0.170.0070.01116.52
7.0.160.0070.01315.87
7.0.150.0040.01816.24
7.0.140.0030.04819.33
7.0.130.0040.01216.32
7.0.120.0070.01016.31
7.0.110.0030.01716.10
7.0.100.0130.05318.31
7.0.90.0220.02918.32
7.0.80.0280.04318.41
7.0.70.0140.02518.42
7.0.60.0090.04918.26
7.0.50.0110.05018.57
7.0.40.0050.03617.42
7.0.30.0030.04717.49
7.0.20.0050.05017.46
7.0.10.0050.03717.30
7.0.00.0080.05117.20
5.6.400.0120.01215.29
5.6.390.0030.02415.47
5.6.380.0030.01715.49
5.6.370.0030.02015.16
5.6.360.0100.01915.41
5.6.350.0070.01515.54
5.6.340.0070.01715.47
5.6.330.0030.01314.89
5.6.320.0000.02215.26
5.6.310.0130.01015.61
5.6.300.0030.01715.55
5.6.290.0030.02015.16
5.6.280.0050.05118.20
5.6.270.0070.01515.00
5.6.260.0030.02015.47
5.6.250.0070.05318.20
5.6.240.0030.05218.31
5.6.230.0040.05218.19
5.6.220.0080.03818.23
5.6.210.0100.04718.23
5.6.200.0080.03218.38
5.6.190.0060.03618.39
5.6.180.0050.05218.50
5.6.170.0080.05018.33
5.6.160.0150.04718.38
5.6.150.0050.03918.31
5.6.140.0050.05118.37
5.6.130.0050.05818.35
5.6.120.0070.04918.23
5.6.110.0130.05218.45
5.6.100.0050.05318.50
5.6.90.0080.05218.35
5.6.80.0030.03318.17
5.6.70.0000.03618.12
5.6.60.0060.04318.11
5.6.50.0030.04818.05
5.6.40.0080.04818.21
5.6.30.0080.02517.94
5.6.20.0080.05217.85
5.6.10.0080.03518.18
5.6.00.0070.03518.09
5.5.380.0020.03318.15
5.5.370.0100.05618.08
5.5.360.0040.05618.07
5.5.350.0070.05218.07
5.5.340.0030.05118.43
5.5.330.0050.05418.28
5.5.320.0070.04118.29
5.5.310.0070.03818.42
5.5.300.0070.05218.36
5.5.290.0100.04518.18
5.5.280.0100.05518.27
5.5.270.0070.05618.23
5.5.260.0050.05218.13
5.5.250.0020.04018.37
5.5.240.0020.05418.02
5.5.230.0050.05318.00
5.5.220.0030.03818.02
5.5.210.0060.04118.13
5.5.200.0070.04617.83
5.5.190.0100.04318.00
5.5.180.0100.04717.98
5.5.170.0030.01714.92
5.5.160.0120.04518.06
5.5.150.0060.03817.97
5.5.140.0070.03417.95
5.5.130.0030.04217.85
5.5.120.0100.05417.88
5.5.110.0020.05018.00
5.5.100.0020.03317.83
5.5.90.0050.03217.93
5.5.80.0030.04517.70
5.5.70.0070.03017.84
5.5.60.0050.02917.98
5.5.50.0020.03418.07
5.5.40.0070.03017.78
5.5.30.0050.03017.75
5.5.20.0070.04217.85
5.5.10.0080.02617.92
5.5.00.0020.03517.75
5.4.450.0030.05316.92
5.4.440.0070.05016.85
5.4.430.0000.05416.85
5.4.420.0130.04416.75
5.4.410.0070.05016.68
5.4.400.0050.04316.69
5.4.390.0020.04916.73
5.4.380.0120.04416.74
5.4.370.0080.03016.71
5.4.360.0120.04016.71
5.4.350.0070.05216.68
5.4.340.0070.03816.58
5.4.330.0000.01413.80
5.4.320.0070.04716.74
5.4.310.0080.04316.65
5.4.300.0050.04916.61
5.4.290.0000.03716.68
5.4.280.0030.05016.59
5.4.270.0030.03316.76
5.4.260.0100.03116.73
5.4.250.0060.03016.60
5.4.240.0050.03016.68
5.4.230.0070.02816.59
5.4.220.0010.04116.69
5.4.210.0060.02716.65
5.4.200.0070.02716.58
5.4.190.0020.02816.58
5.4.180.0080.03316.74
5.4.170.0030.04216.59
5.4.160.0030.03216.67
5.4.150.0070.02716.72
5.4.140.0070.02315.25
5.4.130.0080.04115.39
5.4.120.0070.02915.34
5.4.110.0070.03015.33
5.4.100.0030.02415.43
5.4.90.0030.03015.41
5.4.80.0030.02915.40
5.4.70.0030.02915.37
5.4.60.0020.02915.30
5.4.50.0030.02815.38
5.4.40.0070.02415.32
5.4.30.0030.02815.28
5.4.20.0050.03515.43
5.4.10.0030.02815.39
5.4.00.0050.02615.13
5.3.290.0050.05314.59
5.3.280.0070.03614.56
5.3.270.0050.02914.51
5.3.260.0060.02814.49
5.3.250.0030.03214.55
5.3.240.0020.04514.55
5.3.230.0070.02714.56
5.3.220.0000.03414.49
5.3.210.0050.02714.50
5.3.200.0030.02914.48
5.3.190.0020.03414.55
5.3.180.0030.03114.54
5.3.170.0020.03114.54
5.3.160.0050.02614.54
5.3.150.0020.04314.47
5.3.140.0070.03814.48
5.3.130.0050.03014.46
5.3.120.0020.03114.53
5.3.110.0000.03214.46
5.3.100.0070.02814.36
5.3.90.0020.03014.36
5.3.80.0020.03614.36
5.3.70.0020.03314.36
5.3.60.0030.03114.36
5.3.50.0050.02714.36
5.3.40.0020.03014.36
5.3.30.0050.03214.36
5.3.20.0030.03314.36
5.3.10.0070.03014.36
5.3.00.0080.04814.36
5.2.170.0000.03714.93
5.2.160.0100.02714.93
5.2.150.0100.06014.93
5.2.140.0000.05014.93
5.2.130.0030.03014.93
5.2.120.0070.03014.93
5.2.110.0030.07714.93
5.2.100.0000.04314.93
5.2.90.0030.07714.93
5.2.80.0030.06714.93
5.2.70.0030.08714.93
5.2.60.0070.06314.93
5.2.50.0030.03714.93
5.2.40.0030.05014.93
5.2.30.0070.06314.93
5.2.20.0030.07014.93
5.2.10.0000.07014.93
5.2.00.0030.07314.93
5.1.60.0070.05014.93
5.1.50.0000.06714.93
5.1.40.0000.04014.93
5.1.30.0170.05314.93
5.1.20.0070.07014.93
5.1.10.0170.02714.93
5.1.00.0070.06314.93
5.0.50.0030.04714.93
5.0.40.0000.04714.93
5.0.30.0030.05714.93
5.0.20.0000.04314.93
5.0.10.0000.03014.93
5.0.00.0030.06014.93
4.4.90.0030.03714.93
4.4.80.0000.02314.93
4.4.70.0000.03714.93
4.4.60.0070.02014.93
4.4.50.0000.02014.93
4.4.40.0070.05014.93
4.4.30.0030.03314.93
4.4.20.0000.03714.93
4.4.10.0000.04014.93
4.4.00.0030.05314.93
4.3.110.0030.03014.93
4.3.100.0070.01714.93
4.3.90.0000.03714.93
4.3.80.0000.05314.93
4.3.70.0030.03014.93
4.3.60.0000.02714.93
4.3.50.0000.03314.93
4.3.40.0030.02714.93
4.3.30.0070.02014.93
4.3.20.0000.03014.93
4.3.10.0030.01714.93
4.3.00.0000.01714.93

preferences:
44.72 ms | 401 KiB | 5 Q