Re: [RFC] Deprecate the extract function in PHP 7.3

From: Date: Sat, 16 Sep 2017 11:48:45 +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-100674@lists.php.net to get a copy of this message
"then don't use it" worked great for register_globals and magic_quotes. Not saying it is the same here, but you really ought to have a bit of a mentality adjustment. On 16 Sep 2017 11:36, "lists@rhsoft.net" <lists@rhsoft.net> wrote: Am 15.09.2017 um 19:20 schrieb ilija.tovilo@me.com: > Hi! > > The extract function 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 the extract function takes some options > to make > this function less dangerous, like EXTR_SKIP that prevents an > existing > local variable of being overwritten. There’s a few more options, go ahead > and take a look at the documentation. EXTR_OVERWRITE is 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 > then 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" -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.internals (#100674) next »