Re: [RFC] Permit trailing whitespace in numeric strings
| From: | Robert Hickman | Date: | Wed, 10 Apr 2019 09:36:07 +0000 |
| Subject: | Re: [RFC] Permit trailing whitespace in numeric strings | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105199@lists.php.net to get a copy of this message | ||
> On the balance of things, I would most certainly like to see leading and
> trailing whitespace render a string ineligible to be implicitly
> converted, but I'd be satisfied with (int)" 123 " converting without error.
>
Given that PHP seems to be gradually moving towards more type
strictness, would it make more sense to move this functionality to a
'parse_numeric_string()' function? Js has parseInt() and parseFloat()
with similar functionality.