Just came across this problem, would you mind explaining how this end up having an answer of 4? So basic yet I have no idea how it happened.
echo $a = 20%-8; //4
Answer:
echo (5 % 3)."
"; // prints 2
echo (5 % -3)."
"; // prints 2
echo (-5 % 3)."
"; // prints -2
echo (-5 % -3)."
"; // prints -2