3v4l.org

run code in 300+ PHP versions simultaneously
<?php function distanceGeoPoints ($lat1, $lng1, $lat2, $lng2) { $earthRadius = 3958.75; $dLat = deg2rad($lat2-$lat1); $dLng = deg2rad($lng2-$lng1); $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * sin($dLng/2) * sin($dLng/2); $c = 2 * atan2(sqrt($a), sqrt(1-$a)); $dist = $earthRadius * $c; // from miles $meterConversion = 1609; $geopointDistance = $dist * $meterConversion; return $geopointDistance; } // YOUR CODE HERE echo distanceGeoPoints(53.2168710816799, 6.5573533796185, 53.1402726806595, 6.5633787486733); ?>
Output for git.master, git.master_jit, rfc.property-hooks
8524.9781525601

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
84.57 ms | 401 KiB | 8 Q