On Wed, May 26, 2021 at 11:14 AM Joe Watkins <krak...@php.net> wrote:
> Hi internals, > > In response to: https://bugs.php.net/bug.php?id=78480 > > I implemented: https://github.com/php/php-src/pull/7029 > > Not absolutely convinced that it's a good idea, I asked Nikita to review, > and he's unconvinced also and suggested a discussion should be started. > > I would just like to second (or third, or fourth) the notion that the very possibility of accessing uninitialized state is a bug in the user's code, not a problem for which the language should provide a workaround. If a property is required (i.e. not nullable) it should absolutely and always be initialized in the constructor. I do appreciate PHP being how it is, there might be "valid" use cases for is_initialized() but I also think it will encourage bad practice. Regards Dave