3v4l.org

run code in 300+ PHP versions simultaneously
<?php function destinationPoint($lat, $lng, $brng, $dist) { $rad = 6371; // earths mean radius $dist = $dist/$rad; // convert dist to angular distance in radians $brng = deg2rad($brng); // conver to radians $lat1 = deg2rad($lat); $lon1 = deg2rad($lng); $lat2 = asin(sin($lat1)*cos($dist) + cos($lat1)*sin($dist)*cos($brng) ); $lon2 = $lon1 + atan2(sin($brng)*sin($dist)*cos($lat1),cos($dist)-sin($lat1)*sin($lat2)); $lon2 = fmod($lon2 + 3*M_PI, 2*M_PI) - M_PI; // normalise to -180..+180ยบ $lat2 = rad2deg($lat2); $lon2 = rad2deg($lon2); echo "lat = ".$lat2."\n"; echo "lon = ".$lon2."\n\n"; } $lat = 0; $lng = 0; $dist = 1; // km $n = 12; $bearings = range(0, 360-(360/$n) , 360/$n); // create array of all bearings needed from $lat/$lng foreach($bearings as $brng){ echo $brng ."\n"; destinationPoint($lat, $lng, $brng, $dist); }

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.70.0110.00416.75
8.3.60.0090.00618.55
8.3.50.0110.00418.47
8.3.40.0120.00319.08
8.3.30.0040.01119.23
8.3.20.0050.00322.31
8.3.10.0000.00822.20
8.3.00.0050.00324.02
8.2.190.0100.01017.00
8.2.180.0120.00625.92
8.2.170.0120.00319.38
8.2.160.0100.01022.96
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0070.00021.19
8.2.110.0040.00419.61
8.2.100.0040.00818.16
8.2.90.0090.00318.09
8.2.80.0040.00419.48
8.2.70.0000.00917.75
8.2.60.0000.00817.87
8.2.50.0080.00018.30
8.2.40.0030.00618.43
8.2.30.0040.00417.99
8.2.20.0000.00718.46
8.2.10.0030.00618.59
8.2.00.0060.00318.50
8.1.280.0110.00725.92
8.1.270.0190.00024.51
8.1.260.0120.00626.35
8.1.250.0120.00628.09
8.1.240.0030.00624.17
8.1.230.0080.00321.41
8.1.220.0080.00018.29
8.1.210.0050.00319.12
8.1.200.0000.00917.86
8.1.190.0090.00017.73
8.1.180.0000.00818.10
8.1.170.0040.00417.74
8.1.160.0030.00519.31
8.1.150.0000.00719.46
8.1.140.0040.00418.12
8.1.130.0040.00417.80
8.1.120.0050.00217.93
8.1.110.0090.00117.89
8.1.100.0040.00817.83
8.1.90.0090.00417.85
8.1.80.0050.00917.85
8.1.70.0090.00417.82
8.1.60.0100.00618.00
8.1.50.0080.00717.90
8.1.40.0100.00417.92
8.1.30.0080.00518.04
8.1.20.0080.00418.04
8.1.10.0080.00417.91
8.1.00.0120.00317.84
8.0.300.0000.00720.61
8.0.290.0030.00517.13
8.0.280.0000.00718.34
8.0.270.0030.00718.54
8.0.260.0040.00417.23
8.0.250.0070.00017.35
8.0.240.0020.00617.32
8.0.230.0070.00417.31
8.0.220.0090.00417.26
8.0.210.0080.00517.26
8.0.200.0040.00817.34
8.0.190.0080.00517.31
8.0.180.0100.00417.26
8.0.170.0110.00217.29
8.0.160.0070.00617.31
8.0.150.0050.00717.21
8.0.140.0110.00117.24
8.0.130.0080.00516.09
8.0.120.0100.00317.28
8.0.110.0130.00017.32
8.0.100.0090.00417.37
8.0.90.0040.00917.31
8.0.80.0100.00517.20
8.0.70.0090.00417.25
8.0.60.0090.00417.30
8.0.50.0070.00617.34
8.0.30.0120.00517.26
8.0.20.0100.00917.44
8.0.10.0070.00517.39
8.0.00.0110.00617.20
7.4.330.0050.00015.55
7.4.320.0070.00516.90
7.4.300.0080.00216.96
7.4.290.0100.00416.94
7.4.280.0080.00416.98
7.4.270.0080.00216.91
7.4.260.0110.00316.87
7.4.250.0070.00516.90
7.4.240.0080.00416.92
7.4.230.0080.00516.91
7.4.220.0090.00216.95
7.4.210.0100.00416.85
7.4.200.0090.00216.83
7.4.190.0050.00916.74
7.4.180.0110.00216.83
7.4.160.0090.00716.79
7.4.150.0110.00116.68
7.4.140.0110.00717.52
7.4.130.0100.00616.67
7.4.120.0080.00816.72
7.4.110.0050.00916.70
7.4.100.0100.00616.90
7.4.90.0090.00516.74
7.4.80.0100.00517.68
7.4.70.0120.00416.77
7.4.60.0060.00716.82
7.4.50.0070.00716.76
7.4.40.0080.00716.76
7.4.30.0070.00516.81
7.4.20.0070.00416.84
7.4.10.0070.00316.76
7.4.00.0050.00615.97
7.3.330.0060.00315.79
7.3.320.0090.00315.72
7.3.310.0110.00216.75
7.3.300.0070.00616.65
7.3.290.0070.00616.76
7.3.280.0090.00716.61
7.3.270.0070.00816.77
7.3.260.0150.00316.78
7.3.250.0140.00116.64
7.3.240.0110.00616.78
7.3.230.0140.00316.77
7.3.220.0100.00516.76
7.3.210.0130.00316.71
7.3.200.0090.00616.66
7.3.190.0120.00416.74
7.3.180.0110.00516.69
7.3.170.0100.00616.61
7.3.160.0100.00616.75
7.3.150.0060.00816.72
7.3.140.0120.00416.77
7.3.130.0080.00616.71
7.3.120.0100.00615.91
7.3.110.0060.01115.81
7.3.100.0100.00515.83
7.3.90.0090.00515.97
7.3.80.0060.00815.96
7.3.70.0080.00615.89
7.3.60.0090.00615.89
7.3.50.0060.00915.95
7.3.40.0070.00715.96
7.3.30.0090.00615.98
7.3.20.0060.00717.82
7.3.10.0090.00617.76
7.3.00.0100.00517.75
7.2.340.0090.00516.78
7.2.330.0100.00916.88
7.2.320.0110.00516.97
7.2.310.0140.00216.87
7.2.300.0110.00516.85
7.2.290.0130.00316.80
7.2.280.0060.00816.81
7.2.270.0120.00216.79
7.2.260.0110.00416.89
7.2.250.0090.00616.29
7.2.240.0100.00716.07
7.2.230.0050.01016.10
7.2.220.0080.00616.09
7.2.210.0060.00916.12
7.2.200.0090.00716.12
7.2.190.0080.00716.10
7.2.180.0090.00616.12
7.2.170.0100.00416.10
7.2.160.0070.00716.63
7.2.150.0070.00918.45
7.2.140.0130.00518.32
7.2.130.0090.00718.45
7.2.120.0080.00818.44
7.2.110.0120.00318.40
7.2.100.0100.00718.46
7.2.90.0100.00818.44
7.2.80.0100.00618.42
7.2.70.0070.01018.48
7.2.60.0060.01118.45
7.2.50.0110.00718.35
7.2.40.0870.00618.33
7.2.30.1330.00718.44
7.2.20.0680.00818.33
7.2.10.1230.00718.39
7.2.00.0560.00418.28
7.1.330.0060.00816.85
7.1.320.0060.01016.86
7.1.310.0080.00616.89
7.1.300.0070.00516.83
7.1.290.0070.00716.93
7.1.280.0080.00716.75
7.1.270.0060.00916.88
7.1.260.0080.00516.82
7.1.250.0060.00817.01
7.1.240.0120.00417.70
7.1.230.0100.00617.69
7.1.220.0120.00517.75
7.1.210.0110.00417.70
7.1.200.0090.00517.29
7.1.190.0120.00517.75
7.1.180.0130.00117.62
7.1.170.0110.00617.62
7.1.160.0800.00717.32
7.1.150.1420.00617.30
7.1.140.1580.00617.38
7.1.130.1130.00817.39
7.1.120.1100.00617.55
7.1.110.1080.00617.45
7.1.100.0930.00417.20
7.1.90.2000.00817.30
7.1.80.1190.00617.27
7.1.70.1190.00916.90
7.1.60.1070.00422.99
7.1.50.1040.00722.91
7.1.40.1760.00722.88
7.1.30.1320.00722.79
7.1.20.1870.00822.68
7.1.10.1230.00816.74
7.1.00.1250.00416.67
7.0.330.0080.00517.40
7.0.320.0070.00717.41
7.0.310.0110.00417.52
7.0.300.0090.00517.47
7.0.290.0100.00817.41
7.0.280.0140.00117.39
7.0.270.0120.00117.40
7.0.260.0090.00417.46
7.0.250.0090.00517.64
7.0.240.0060.00817.54
7.0.230.0090.00417.67
7.0.220.0070.00617.48
7.0.210.0110.00217.41
7.0.200.0160.00217.56
7.0.190.0110.00217.33
7.0.180.0120.00217.42
7.0.170.0120.00217.46
7.0.160.0090.00417.51
7.0.150.0080.00517.41
7.0.140.0100.00417.44
7.0.130.0080.00517.38
7.0.120.0110.00317.47
7.0.110.0100.00417.44
7.0.100.0100.00317.49
7.0.90.0070.00617.21
7.0.80.0120.00117.34
7.0.70.0130.00217.27
7.0.60.0120.00217.38
7.0.50.0090.00517.45
7.0.40.0080.00517.44
7.0.30.0090.00417.45
7.0.20.0080.00517.41
7.0.10.0070.00517.38
7.0.00.0050.00617.24
5.6.400.0120.00216.27
5.6.390.0090.00516.27
5.6.380.0090.00516.26
5.6.370.0060.00816.26
5.6.360.0110.00316.27
5.6.350.0070.00616.29
5.6.340.0060.00716.18
5.6.330.0070.00716.28
5.6.320.0140.00016.26
5.6.310.0140.00016.14
5.6.300.0080.00616.12
5.6.290.0100.00416.22
5.6.280.0070.00716.31
5.6.270.0100.00416.18
5.6.260.0110.00216.23
5.6.250.0090.00416.12
5.6.240.0060.00816.33
5.6.230.0060.00616.29
5.6.220.0100.00316.28
5.6.210.0090.00516.25
5.6.200.0140.00016.41
5.6.190.0110.00216.26
5.6.180.0100.00416.36
5.6.170.0090.00516.29
5.6.160.0100.00316.39
5.6.150.0110.00216.34
5.6.140.0100.00316.28
5.6.130.0140.00016.32
5.6.120.0060.00816.38
5.6.110.0110.00216.14
5.6.100.0110.00216.18
5.6.90.0090.00516.04
5.6.80.0090.00416.06
5.6.70.0050.00816.23
5.6.60.0050.00716.46
5.6.50.0090.00416.20
5.6.40.0110.00216.40
5.6.30.0080.00516.08
5.6.20.0110.00216.10
5.6.10.0110.00216.10
5.6.00.0080.00616.12

preferences:
22.03 ms | 401 KiB | 5 Q