3v4l.org

run code in 300+ PHP versions simultaneously
<?php $endDateSplit1 = 600; $endDateSplit2 = 550; $r = abs($endDateSplit1 - 500) < abs($endDateSplit2 - 500) ? -1 : 1; echo $r;

preferences:
70.83 ms | 402 KiB | 5 Q