php-7 Generic numerical example


Example

Generic example in a form of $a <=> $b matrix.

0 <=> 1; // -1 (left operand less than right, right is greater)
0 <=> 0; // 0 (operands are equal)
1 <=> 0; // 1 (left operand greater than right, left is greater)
1 <=> 1; // 0 (operands are equal)

╔═══════╦════╦════╗
║ $a/$b ║  0 ║  1 ║
╠═══════╬════╬════╣
║   0   ║  0 ║ -1 ║
║   1   ║  1 ║  0 ║
╚═══════╩════╩════╝

$a - leftmost column, $b - topmost row