Re: About declare(strict_types = 1)
| From: | Nikita Nefedov | Date: | Mon, 16 Mar 2015 12:30:28 +0000 |
| Subject: | Re: About declare(strict_types = 1) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85044@lists.php.net to get a copy of this message | ||
On Mon, 16 Mar 2015 14:50:16 +0300, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
I already showed real world example how this could be fail. If we need this kind of behavior. I would suggest to have type affinity like SQLite for $_GET/$_POST/$_COOKIE. https://www.sqlite.org/datatype3.html This would work better to work with strict types.I don't see how, given your example, anything would fail. Do you imply that function would get coerced value, but outside of the function you would still have a string and the problem that this string could contain anything? If that's what you were trying to say then I don't consider this as a problem, it's natural flow. If you were to implement type verification in your function on your own you'd get the same results. Perhaps you meant something different?