On 26/04/2022 14:53, Andreas Leathley wrote:
'on' is only true by "accident" though, because it is a non-empty
string, not because of its meaning, and then it is likely that the value
'off' could also be added at some point - which also would be true.
The reason I gave that particular example is that it's the default
submission value for an HTML checkbox when checked; if it's not checked,
it has no value at all (not even an empty string), so in that particular
context there is no corresponding "off".
I think it falls into the same category as something like '1e3' being
considered numeric - occasionally useful, but probably not worth the
potential confusion of a special case.
Regards,
--
Rowan Tommins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php