PHP 8.1 RFC: Deprecate autovivification on false

Deprecate autovivification on false
PHP 8.1
In Voting Passing

RFC Vote: Deprecate autovivification on false

> 50%
Yes: 25No: 2

Deprecate autovivification on false

Version PHP 8.1

PHP natively allows for autovivification (auto-creation of arrays from falsey values). This feature is very useful and used in a lot of PHP projects, especially if the variable is undefined. However, there is a little oddity that allows creating an array from a false and null value.

The proposal is to disallow autovivification from false values

Subscribe to PHP.Watch newsletter for monthly updates

You will receive an email on last Wednesday of every month and on major PHP releases with new articles related to PHP, upcoming changes, new features and what's changing in the language. No marketing emails, no selling of your contacts, no click-tracking, and one-click instant unsubscribe from any email you receive.