Re: [RFC] Base Conversion Clowniness
| From: | Andrea Faulds | Date: | Sun, 22 Dec 2013 22:35:16 +0000 |
| Subject: | Re: [RFC] Base Conversion Clowniness | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70838@lists.php.net to get a copy of this message | ||
On 22/12/13 22:26, Stas Malyshev wrote:
Hi!I think it depends which release. If next 5.x, then I think a warning might be acceptable. My personal preference would be to make it act largely like string to int conversion works at present, where it stops at incorrect chars. Though I think it's tolerant of leading whitespace, for some reason, which I don't like. Hence, for some sort of consistency, I like option C best. I don't think throwing a warning in the next 5.x.y is a good idea though, but I personally don't think it's a bad idea for 5.6. However, my preferred behaviour would break B/C, so I'm not sure. -- Andrea Faulds http://ajf.me/https://wiki.php.net/rfc/base-convertJust a little note - I don't think any option that adds warnings where there were not warnings is acceptable in this case for any stable version. There are dozens of ways extra warning could break an existing app. Also, wouldn't simple regexp or filter or is_numeric check solve this issue while allowing much more flexible reaction to wrong data? I'm not sure that more warnings is better than more data checking.