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

From: 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! 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"

« previous php.internals (#100661) next »