Re: [RFC] Deprecate the extract function in PHP 7.3
| From: | lists@rhsoft.net | Date: | Sat, 16 Sep 2017 09:35:45 +0000 |
| Subject: | Re: [RFC] Deprecate the extract function in PHP 7.3 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100661@lists.php.net to get a copy of this message | ||
Am 15.09.2017 um 19:20 schrieb ilija.tovilo@me.com:
Hi! Thethen don't use it - who are you proposing remove functionality because you don't use it - fine, nobody forces you to do so - a foreach() replacement would miss EXTR_OVERWRITE - this whole thread is a "have solution, looking for a problem"extractfunction takes an associative array and puts it into the local symbol table. http://php.net/manual/en/function.extract.php$array = [ ‘foo’ => ‘foo’, ‘bar’ => ‘bar’, ]; extract($array); print $foo; // "foo"As a second parameter theextractfunction takes some options to make this function less dangerous, likeEXTR_SKIPthat prevents an existing local variable of being overwritten. There’s a few more options, go ahead and take a look at the documentation.EXTR_OVERWRITEis the default one though. You can also pass a prefix for the variable names as a third argument. I seriously doubt the usefulness of this function