Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-13 Thread Dmitry Stogov
On Jun 10, 2018 10:46 PM, "Hoffman, Zachary Robert" wrote: >The existence of anything that internally relies on `get_defined_vars()` is a >blocker for applying further optimisations to the engine (think stack frames), >which is probably why Dmitry suggested its removal. I did not know it was an

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-11 Thread Rowan Collins
On 11 June 2018 at 07:14, Hoffman, Zachary Robert wrote: > > However, even if those 4 values end up being stored in a structure, I > don't want to manipulate that structure within that class method itself, I > want to perform computations with local variables. If I have to separately > store thos

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Hoffman, Zachary Robert
On Sun, 2018-06-10 at 23:49 +0100, Rowan Collins wrote: > On 10/06/2018 19:41, Hoffman, Zachary Robert wrote: > > Deprecating compact() would hurt workflows where you use the same > > variable names > > several times in different contexts, even though they are only > > declared locally > > for the

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Rowan Collins
On 10/06/2018 19:41, Hoffman, Zachary Robert wrote: Deprecating compact() would hurt workflows where you use the same variable names several times in different contexts, even though they are only declared locally for the purposes of compact() itself. I am not convinced that building logic aroun

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Hoffman, Zachary Robert
>The existence of anything that internally relies on `get_defined_vars()` is a >blocker for applying further optimisations to the engine (think stack frames), >which is probably why Dmitry suggested its removal. I did not know it was an optimization issue. I suppose I could substitute a userland

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Marco Pivetta
= (new A())->c(); > > foreach (A::b() as $b) { > echo $a->a($b) . PHP_EOL; > } > > The alternative would be manipulating array elements directly, like this: > > public function c() > { > $e['d'] = $this->d(); > $e['a'] = pow($

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-10 Thread Hoffman, Zachary Robert
rray elements directly, like this: public function c() { $e['d'] = $this->d(); $e['a'] = pow($e['d'], $e['d'] + 1); $e['c'] = $e['a'] ^ 0b1100; $e['b'] = $e['a'] - $e['d']; return new

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-09 Thread Gabriel Caruso
> > Hi Gabriel, > >> compact(), extract(), parse_str() (with 1 argument) and >> get_defined_vars() are bad functions, because they access local variables >> indirectly. >> >> They might be considered to be removed in the next major PHP version, >> despite of this fix. >> >> >> Thanks. Dmitry. >> >>

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-09 Thread Sebastian Bergmann
Am 09.06.2018 um 12:03 schrieb Dmitry Stogov: > They might be considered to be removed in the next major PHP version, despite > of this fix. +1 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-09 Thread Dmitry Stogov
. From: Gabriel Caruso Sent: Wednesday, June 6, 2018 3:58:24 PM To: PHP Internals Subject: [PHP-DEV] [VOTE] Make compact function reports undefined passed variables Hello there. I'd like to announce that I've opened the RFC for voting until 06/18. https://wiki.php.net/rfc/compa

[PHP-DEV] [VOTE] Make compact function reports undefined passed variables

2018-06-06 Thread Gabriel Caruso
Hello there. I'd like to announce that I've opened the RFC for voting until 06/18. https://wiki.php.net/rfc/compact Thanks. -- Gabriel Caruso