[RFC] Make compact function reports undefined passed variables

php.internals

Gabriel Caruso

8 years ago
Hello Internals. I'd like to announce my new RFC: https://wiki.php.net/rfc/compact. This was already previously discussed (https://externals.io/message/102012) and now I have officially opened the RFC so we can discuss, improve and vote it. Thanks in advance,
-- Gabriel Caruso

Nikita Popov

8 years ago
On Fri, May 25, 2018 at 4:17 AM, Gabriel Caruso <carusogabriel34@gmail.com> wrote:
> Hello Internals. > > > I'd like to announce my new RFC: https://wiki.php.net/rfc/compact. > > > This was already previously discussed (https://externals.io/message/102012 > ) > and now I have officially opened the RFC so we can discuss, improve and > vote it. > > > Thanks in advance, > -- > Gabriel Caruso >
Sounds reasonable to me. An undefined variable in compact() is most likely a typo, not an intentional use of a conditionally defined variable. Nikita

Sammy Kaye Powers

8 years ago
On Thu, May 24, 2018 at 10:17 PM, Gabriel Caruso <carusogabriel34@gmail.com> wrote:
> Hello Internals. > > > I'd like to announce my new RFC: https://wiki.php.net/rfc/compact. > > > This was already previously discussed (https://externals.io/message/102012) > and now I have officially opened the RFC so we can discuss, improve and > vote it. > > > Thanks in advance, > -- > Gabriel Caruso
I love it as it would help guard against obscure bugs. I would suggest raising an E_NOTICE instead of an E_WARNING as that is the typical behavior of undefined variables elsewhere. :) Thanks, Sammy Kaye Powers sammyk.me

Gabriel Caruso

8 years ago
Sammy, thanks for point it. Just test a simple code (https://3v4l.org/0QQ9S) to confirm that. Gonna change it in the implementation. Em sex, 25 de mai de 2018 às 08:45, Sammy Kaye Powers <me@sammyk.me> escreveu:
> On Thu, May 24, 2018 at 10:17 PM, Gabriel Caruso > <carusogabriel34@gmail.com> wrote: > > Hello Internals. > > > > > > I'd like to announce my new RFC: https://wiki.php.net/rfc/compact. > > > > > > This was already previously discussed ( > https://externals.io/message/102012) > > and now I have officially opened the RFC so we can discuss, improve and > > vote it. > > > > > > Thanks in advance, > > -- > > Gabriel Caruso > > I love it as it would help guard against obscure bugs. > > I would suggest raising an E_NOTICE instead of an E_WARNING as that is > the typical behavior of undefined variables elsewhere. :) > > Thanks, > Sammy Kaye Powers > sammyk.me >
-- Gabriel Caruso