3v4l.org

run code in 300+ PHP versions simultaneously
<?php function diff($this, $that){ $diff = abs((deg2rad($this)+M_PI_2)-(deg2rad($that)+M_PI_2)); $diff = min( M_PI_2 - $diff, $diff); echo rad2deg($diff) .PHP_EOL; } diff(-1,1);//2 diff(-90,90);//180 diff(-179,179);//2

preferences:
36.2 ms | 402 KiB | 5 Q