3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lat1 = 35.697959; $lat2 = 35.697959; $lon1 = 139.707085; $lon2 = 139.707085; $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); var_dump($dist); // returns 1 $dist = acos(min(max($dist,-1.0),1.0)); var_dump($dist); // returns NAN $x = 1; $x = acos($x); var_dump($x); // doesn't return NAN
Output for git.master_jit, git.master, rfc.property-hooks
float(1.0000000000000002) float(0) float(0)

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:
43.28 ms | 405 KiB | 5 Q