Using extract() with $this

  105649
May 8, 2019 21:16 php@duncanc.co.uk (Craig Duncan)
Hi everyone,

I've just opened a pull request for some changes to *extract()* handling of
*$this*
https://github.com/php/php-src/pull/4133

I had a look through the original RFC discussion, and it looks like
extract() was brought up and then quickly handled, but it seems like the
handling was a bit over the top.
https://externals.io/message/93457

As reported in the below bug, extract() throws an exception when the
documentation suggests that it should be able to handle the scenario
(either by ignoring the request to overwrite *$this* or by creating a
prefixed version of it).
https://bugs.php.net/bug.php?id=77135

The only one I'm unsure of is the *IF_EXISTS* flags, as *$this* isn't in
the symbol table it's ignored even though technical *$this* does exist. But
as this is the current behaviour and doesn't cause an issue I thought for
BC it would be best to leave this behaviour alone.

Does anybody disagree with this change? Does it need an RFC?
  105652
May 9, 2019 14:11 nikita.ppv@gmail.com (Nikita Popov)
On Wed, May 8, 2019 at 11:16 PM Craig Duncan <php@duncanc.co.uk> wrote:

> Hi everyone, > > I've just opened a pull request for some changes to *extract()* handling of > *$this* > https://github.com/php/php-src/pull/4133 > > I had a look through the original RFC discussion, and it looks like > extract() was brought up and then quickly handled, but it seems like the > handling was a bit over the top. > https://externals.io/message/93457 > > As reported in the below bug, extract() throws an exception when the > documentation suggests that it should be able to handle the scenario > (either by ignoring the request to overwrite *$this* or by creating a > prefixed version of it). > https://bugs.php.net/bug.php?id=77135 > > The only one I'm unsure of is the *IF_EXISTS* flags, as *$this* isn't in > the symbol table it's ignored even though technical *$this* does exist. But > as this is the current behaviour and doesn't cause an issue I thought for > BC it would be best to leave this behaviour alone. > > Does anybody disagree with this change? Does it need an RFC? >
These changes sound reasonable to me. I don't think it needs an RFC -- this is more of a bug fix. Nikita