Validating whether a number is within a closed or open interval is
currently possible only via a construct like the following:
```
if (0 < $x && $x < 42) {
echo 'x is in (0, 42)';
}
if (0 <= $x && $x <= 42) {
echo 'x is in [0, 42]';
}
```
It is not very readable and repetitive. It would be interesting to
support a more mathematical notation for this:
```
if (0 < $x < 42) {
echo 'x is in (0, 42)';
}
if (0 <= $x <= 42) {
echo 'x is in [0, 42]';
}
```
I cannot judge how complicated it is to extend the Bison definitions to
allow this. However, if there is interest I'm sure there is a way. :)
--
Richard "Fleshgrinder" Fussenegger
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php