3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $latitude1 = 50.1; $latitude2 = 34.0; $longitude1 = 50.5; $longitude2 = 37.9; $theta = $longitude1 - $longitude2; $miles = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); $miles = acos($miles); $miles = rad2deg($miles); $miles = $miles * 60 * 1.1515; $kilometers = $miles * 1.609344; echo(number_format($kilometers,2));
based on 3AY9J
Output for 4.3.0 - 7.2.0
2,064.06