Re: [RFC] Deprecate the extract function in PHP 7.3
| From: | Stanislav Malyshev | Date: | Fri, 15 Sep 2017 21:05:36 +0000 |
| Subject: | Re: [RFC] Deprecate the extract function in PHP 7.3 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100652@lists.php.net to get a copy of this message | ||
Hi!
> Dangerous meaning that if given untrusted input someone could mess with
> the behaviour of your code. There are risks and benefits to every
Same as many other functions. Given untrusted input, unlink() could
delete files on your hard drive, and file_put_contents() could overwrite
your data or send it to unauthorized party. That's not the reason to
remove these functions.
> solution. Certainly you’d agree that in some cases the risks outweigh
> the benefits.
In some cases, yes. In this case, no, as there is no special risks not
existing in many other functions. Any function that has side effects
could do something unexpected when you give it unexpected input. Since
we're not converting PHP to be purely functional language just yet, the
solution is to use functions correctly, not remove them.
--
Stas Malyshev
smalyshev@gmail.com