3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Get an array of human readable times for sun events * @param \DateTime $date A \DateTime Object set to the desired date * and the correct timezone for the place in question * @param float $lat The latitude of the place in question * @param float $lon The longitude of the place in question * * @return array An associative array of human readable times sorted in chronological order. */ function adjustedSunInfo(\DateTime $date,$lat,$lon) { $sinfo=date_sun_info ($date->getTimestamp() ,$lat,$lon ); foreach($sinfo as $key=>$val) { //You should check that the value isn't 1 or empty first $time = new \DateTime('@' . $val); $time->setTimezone($date->getTimeZone()); $sinfo[$key] = $time->format('Y m d H:i:s'); } asort($sinfo); return $sinfo; } $time = new \DateTime('2013-01-01', new \DateTimeZone('Pacific/Chatham')); var_dump(adjustedSunInfo($time, -44.5, -176.2));

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.80.0090.00617.97
8.3.70.0150.00717.13
8.3.60.0070.01418.93
8.3.50.0040.01123.13
8.3.40.0070.01119.07
8.3.30.0070.00719.17
8.3.20.0000.00820.79
8.3.10.0090.00622.23
8.3.00.0040.00419.55
8.2.200.0090.00018.79
8.2.190.0040.01117.00
8.2.180.0130.00617.13
8.2.170.0070.00722.96
8.2.160.0070.00719.66
8.2.150.0030.00625.66
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0070.00021.30
8.2.110.0070.00319.95
8.2.100.0090.00318.53
8.2.90.0050.00319.89
8.2.80.0080.00019.92
8.2.70.0080.00018.50
8.2.60.0000.00818.66
8.2.50.0080.00318.25
8.2.40.0110.00021.23
8.2.30.0040.00419.83
8.2.20.0080.00018.35
8.2.10.0040.00418.88
8.2.00.0060.00318.71
8.1.290.0050.00518.88
8.1.280.0170.00325.92
8.1.270.0080.00024.19
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00423.30
8.1.230.0000.01118.27
8.1.220.0080.00018.41
8.1.210.0050.00318.77
8.1.200.0110.00018.10
8.1.190.0050.00317.97
8.1.180.0030.00618.10
8.1.170.0080.00019.07
8.1.160.0070.00022.69
8.1.150.0050.00321.27
8.1.140.0030.00620.08
8.1.130.0040.00418.20
8.1.120.0040.00418.05
8.1.110.0040.00417.95
8.1.100.0000.00818.07
8.1.90.0050.00218.01
8.1.80.0030.00518.11
8.1.70.0040.00418.18
8.1.60.0060.00318.16
8.1.50.0000.00918.05
8.1.40.0040.00418.10
8.1.30.0030.00518.24
8.1.20.0000.00818.25
8.1.10.0000.00818.16
8.1.00.0030.00618.15
8.0.300.0000.00718.77
8.0.290.0040.00417.50
8.0.280.0000.00719.05
8.0.270.0050.00317.82
8.0.260.0000.00617.76
8.0.250.0040.00417.75
8.0.240.0070.00017.63
8.0.230.0040.00417.79
8.0.220.0040.00417.66
8.0.210.0000.00717.56
8.0.200.0030.00317.71
8.0.190.0070.00017.77
8.0.180.0050.00217.69
8.0.170.0080.00017.69
8.0.160.0000.00817.69
8.0.150.0000.00717.47
8.0.140.0000.00717.64
8.0.130.0030.00314.02
8.0.120.0000.01017.61
8.0.110.0030.00617.51
8.0.100.0070.00017.64
8.0.90.0040.00417.82
8.0.80.0030.01317.52
8.0.70.0070.00017.70
8.0.60.0000.00717.83
8.0.50.0000.00717.71
8.0.30.0120.00817.51
8.0.20.0130.00817.79
8.0.10.0040.00417.91
8.0.00.0070.01017.20
7.4.330.0050.00015.08
7.4.320.0000.00717.19
7.4.300.0030.00317.02
7.4.290.0000.00717.12
7.4.280.0000.00817.04
7.4.270.0000.00717.13
7.4.260.0080.00017.04
7.4.250.0030.00616.95
7.4.240.0000.00817.19
7.4.230.0040.00417.25
7.4.220.0100.00717.13
7.4.210.0110.00317.12
7.4.200.0030.00317.07
7.4.160.0060.01217.25
7.4.150.0120.00817.40
7.4.140.0140.00717.86
7.4.130.0130.00617.03
7.4.120.0080.00917.16
7.4.110.0100.01317.07
7.4.100.0100.00717.11
7.4.90.0090.00917.00
7.4.80.0150.00319.39
7.4.70.0140.00317.14
7.4.60.0100.00717.04
7.4.50.0030.01017.26
7.4.40.0110.01117.00
7.4.30.0160.00317.14
7.4.00.0070.00715.73
7.3.330.0030.00514.01
7.3.320.0050.00013.92
7.3.310.0030.00316.89
7.3.300.0070.00016.99
7.3.290.0100.00816.85
7.3.280.0110.00716.85
7.3.270.0150.00617.40
7.3.260.0100.00816.94
7.3.250.0120.00716.90
7.3.240.0060.01316.90
7.3.230.0170.00016.94
7.3.210.0100.00716.92
7.3.200.0090.01416.97
7.3.190.0110.00717.16
7.3.180.0130.01017.00
7.3.170.0100.00617.29
7.3.160.0060.01017.02
7.3.120.0000.01815.36
7.3.110.0030.01015.37
7.3.100.0090.00915.68
7.3.90.0040.00915.64
7.3.80.0070.00315.53
7.3.70.0030.01015.45
7.3.60.0050.00515.52
7.3.50.0110.00615.67
7.3.40.0030.00615.82
7.3.30.0060.00615.55
7.3.20.0060.00317.67
7.3.10.0080.00817.29
7.3.00.0040.00717.29
7.2.330.0170.00317.33
7.2.320.0090.00917.32
7.2.310.0110.00717.32
7.2.300.0130.00316.95
7.2.290.0110.00717.39
7.2.240.0100.00616.14
7.2.230.0060.00915.87
7.2.220.0030.00715.80
7.2.210.0070.00715.65
7.2.200.0120.00616.07
7.2.190.0060.00915.88
7.2.180.0130.00315.95
7.2.170.0000.01216.00
7.2.160.0110.00415.97
7.2.150.0000.01517.59
7.2.140.0000.01017.92
7.2.130.0000.00817.84
7.2.120.0060.00917.53
7.2.110.0030.00717.63
7.2.100.0100.00717.66
7.2.90.0060.00917.91
7.2.80.0040.00817.83
7.2.70.0070.01017.91
7.2.60.0070.00817.75
7.2.50.0080.00417.91
7.2.40.0040.00817.63
7.2.30.0070.01117.86
7.2.20.0070.00717.81
7.2.10.0090.00617.92
7.2.00.0020.00918.80
7.1.330.0030.01016.75
7.1.320.0100.00316.48
7.1.310.0100.00716.24
7.1.300.0030.00616.71
7.1.290.0070.00716.39
7.1.280.0030.00716.73
7.1.270.0070.00716.73
7.1.260.0110.00416.49
7.1.250.0070.00716.79
7.1.200.0000.00916.71
7.1.70.0050.00517.75
7.1.60.0140.01119.90
7.1.00.0070.07322.73
7.0.200.0060.00915.88
7.0.70.0430.05720.17
7.0.60.0430.05020.36
7.0.50.0370.05320.57
7.0.40.0400.05320.50
7.0.30.0270.07020.60
7.0.20.0470.07320.59
7.0.10.0400.06020.59
7.0.00.0400.05720.60
5.6.280.0070.07021.49
5.6.220.0330.05720.97
5.6.210.0530.05021.02
5.6.200.0300.06321.45
5.6.190.0300.06321.29
5.6.180.0230.06721.31
5.6.170.0470.05021.44
5.6.160.0330.06321.48
5.6.150.0570.04721.33
5.6.140.0230.07321.43
5.6.130.0100.06321.39
5.6.120.0170.05721.38
5.6.110.0130.06721.35
5.6.100.0270.06021.46
5.6.90.0330.05721.36
5.6.80.0300.05720.70
5.6.70.0330.05320.82
5.6.60.0370.05020.71
5.6.50.0300.06020.70
5.6.40.0270.06020.79
5.6.30.0330.05720.74
5.6.20.0100.05720.69
5.6.10.0270.05020.67
5.6.00.0100.06020.68
5.5.360.0270.05720.62
5.5.350.0330.06320.74
5.5.340.0400.04721.09
5.5.330.0330.05721.14
5.5.320.0330.05321.14
5.5.310.0430.04721.11
5.5.300.0000.07021.18
5.5.290.0270.06721.19
5.5.280.0170.05321.11
5.5.270.0470.05021.15
5.5.260.0230.06721.22
5.5.250.0500.05321.03
5.5.240.0370.05020.51
5.5.230.0430.04720.55
5.5.220.0400.05020.63
5.5.210.0330.05320.43
5.5.200.0270.06020.43
5.5.190.0330.06020.54
5.5.180.0330.05320.50
5.5.160.0130.05320.43
5.5.150.0100.05720.52
5.5.140.0330.05720.43
5.5.130.0230.06020.56
5.5.120.0330.04720.43
5.5.110.0300.05320.47
5.5.100.0270.05720.48
5.5.90.0270.05720.45
5.5.80.0270.06020.40
5.5.70.0270.05720.41
5.5.60.0300.05320.36
5.5.50.0300.05720.35
5.5.40.0370.05020.30
5.5.30.0300.05320.39
5.5.20.0370.05020.48
5.5.10.0330.05720.32
5.5.00.0300.06020.34

preferences:
30.86 ms | 401 KiB | 5 Q