3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('KM', 6364.963); define('MILES', 3955.00465); function GetDistance($la1, $lo1, $la2, $lo2, $r = KM) { $l1 = deg2rad($la1); $l2 = deg2rad($la2); $dg = deg2rad($lo2 - $lo1); $d = $r * acos(sin($l1) * sin($l2) + cos($l1) * cos($l2) * cos($dg)); return $d; } $lat1 = 55; $long1 = 12; $lat2 = 34; $long2 = -118; echo "The distance from Copenhagen to Los Angeles is " . round(GetDistance($lat1, $long1, $lat2, $long2)) . " km\n"; echo "The distance from Copenhagen to Los Angeles is " . round(GetDistance($lat1, $long1, $lat2, $long2, MILES)) . " miles\n"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
The distance from Copenhagen to Los Angeles is 9024 km The distance from Copenhagen to Los Angeles is 5607 miles

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:
44.34 ms | 401 KiB | 8 Q