# [VOTE] Deprecate autovivification on false

- Thread: https://staging.externals.io/message/114802
- Original archive: https://news-web.php.net/php.internals/114802
- Started by Kamil Tekiela on 2021-06-09T20:24:01+00:00
- Messages: 7
- RFC: Disable autovivification on false (Accepted) — https://staging.externals.io/rfc/autovivification_false.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://staging.externals.io/search.md?q={query} · RFCs at https://staging.externals.io/rfc.md · JSON API at https://staging.externals.io/api · documentation at https://staging.externals.io/llms.txt

---

## #114802 — Kamil Tekiela — 2021-06-09T20:24:01+00:00

URL: https://staging.externals.io/message/114802#114802

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 — Dmitry Stogov — 2021-06-11T06:58:17+00:00

URL: https://staging.externals.io/message/114802#114825 · In reply to: #114802

hi,

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

Thanks. Dmitry.



> 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 — Claude Pache — 2021-06-11T09:19:57+00:00

URL: https://staging.externals.io/message/114802#114826 · In reply to: #114825

> 
> 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 — Dmitry Stogov — 2021-06-11T09:47:42+00:00

URL: https://staging.externals.io/message/114802#114827 · In reply to: #114826

On Fri, Jun 11, 2021 at 12:19 PM Claude Pache <claude.pache@gmail.com>
wrote:

>
> > […]
> "No",
> > […]
>
>
> 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 — Kamil Tekiela — 2021-06-11T12:13:49+00:00

URL: https://staging.externals.io/message/114802#114829 · In reply to: #114827

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 — Dmitry Stogov — 2021-06-15T07:17:41+00:00

URL: https://staging.externals.io/message/114802#114876 · In reply to: #114829

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.





> 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

---

## #115078 — Kamil Tekiela — 2021-06-23T21:13:24+00:00

URL: https://staging.externals.io/message/114802#115078 · In reply to: #114876

Hi All,

The voting on https://wiki.php.net/rfc/autovivification_false has been
closed. The RFC is accepted with score 34:2 (94%)

Thanks,
Kamil
