[PHP-DEV] [VOTE] Deprecate autovivification on false

  114802
June 9, 2021 20:24 tekiela246@gmail.com (Kamil Tekiela)
Hi Internals,

I have limited the RFC to disabling autovivification on false only, which
was the initial scope of the RFC. The only two possible cases remaining
will be undefined and null. After what Tyson Andre clearly explained, null
is commonly used and leads to many more complex situations.

I have opened voting on https://wiki.php.net/rfc/autovivification_false
which will end on 2021-06-23T20:00:00Z

Link to the discussion thread: https://externals.io/message/114595

The implementation is pending, but if someone wants to suggest one, please
feel free.

Regards,
Kamil
  114825
June 11, 2021 06:58 dmitrystogov@gmail.com (Dmitry Stogov)
hi,

I wouldn't care about disabling autovivification on false, but I vote "No",
because I'm against the deprecation.

Thanks. Dmitry.

On Wed, Jun 9, 2021 at 11:24 PM Kamil Tekiela <tekiela246@gmail.com> wrote:

> Hi Internals, > > I have limited the RFC to disabling autovivification on false only, which > was the initial scope of the RFC. The only two possible cases remaining > will be undefined and null. After what Tyson Andre clearly explained, null > is commonly used and leads to many more complex situations. > > I have opened voting on https://wiki.php.net/rfc/autovivification_false > which will end on 2021-06-23T20:00:00Z > > Link to the discussion thread: https://externals.io/message/114595 > > The implementation is pending, but if someone wants to suggest one, please > feel free. > > Regards, > Kamil >
  114826
June 11, 2021 09:19 claude.pache@gmail.com (Claude Pache)
> > I wouldn't care about disabling autovivification on false, but I vote "No", > because I'm against the deprecation.
Do you mean, you wouldn’t care if it went directly from “working without notice” in PHP 8.0 to “fatal error” in PHP 8.1? That would be extremely hostile for large code bases in their upgrading process, as it is in general not a feature that can be checked and corrected statically. —Claude
  114827
June 11, 2021 09:47 dmitrystogov@gmail.com (Dmitry Stogov)
On Fri, Jun 11, 2021 at 12:19 PM Claude Pache pache@gmail.com>
wrote:

> > > > > I wouldn't care about disabling autovivification on false, but I vote > "No", > > because I'm against the deprecation. > > > Do you mean, you wouldn’t care if it went directly from “working without > notice” in PHP 8.0 to “fatal error” in PHP 8.1? That would be extremely > hostile for large code bases in their upgrading process, as it is in > general not a feature that can be checked and corrected statically. >
The RFC doesn't provide implementation, and I see that the implementation of this deprecation may be not as simple as expected. Thanks. Dmitry.
> —Claude
  114829
June 11, 2021 12:13 tekiela246@gmail.com (Kamil Tekiela)
Hi Dmitry,

Thanks for voicing your concerns.
I have started writing implementation and it is definitely challenging for
me, because I am not that experienced with PHP internals yet.
https://github.com/php/php-src/pull/7131

Almost every implementation requires some amount of work. I would like to
ask you for more details on why you think this particular change is
infeasible. Do you see any problems that the implementation of this
deprecation message would cause? Would it be better to wait for PHP 9.0 and
remove it without deprecation?
As I see it, we already have an error for other scalar types. For false, we
will just need to throw a deprecation notice in the same places. It doesn't
require a major rewrite of PHP engine from what I can tell.

Regards,
Kamil
  114876
June 15, 2021 07:17 dmitrystogov@gmail.com (Dmitry Stogov)
Hi Kamil,

PHP warnings are tricky, error handlers may cause side effects, throw
exceptions, etc.
Especially, for this deprecation you'll have to handle a new "slow" path
(in VM and JIT) that should return back to the main path.

Thanks. Dmitry.



On Fri, Jun 11, 2021 at 3:13 PM Kamil Tekiela <tekiela246@gmail.com> wrote:

> Hi Dmitry, > > Thanks for voicing your concerns. > I have started writing implementation and it is definitely challenging for > me, because I am not that experienced with PHP internals yet. > https://github.com/php/php-src/pull/7131 > > Almost every implementation requires some amount of work. I would like to > ask you for more details on why you think this particular change is > infeasible. Do you see any problems that the implementation of this > deprecation message would cause? Would it be better to wait for PHP 9.0 and > remove it without deprecation? > As I see it, we already have an error for other scalar types. For false, > we will just need to throw a deprecation notice in the same places. It > doesn't require a major rewrite of PHP engine from what I can tell. > > Regards, > Kamil >