I have an engine that does some mathematical and logical operations by taking formulas, operands and operators from a file.
All the operations are executed in an eval scope and the final result is saved in another file.
These files are often transferred through a network, so I am trying to minimize them by stripping all the spaces before and after operations. As far as I know there are no strict rules about that matter, however I stumbled upon this behavior:
$x = 1;
$result = $x++-++$x; // works
$result = $x+++++$x; // fails
$result = $x++ + ++$x; // works again
Why is PHP confused by the "+++++" syntax, but accepts "++-++"? How is "plus" better than "minus"?
Is there a list anywhere of operators that are sensitive about spaces?