1.2.448. False To Array Conversion¶
The auto vivification of false is deprecated. This feature is the automagical conversion of a boolean into an array, if needed.
Until PHP 8.1, this was possible. This feature is deprecated in PHP 8.1, and will be removed in PHP 9.0.
<?php
$a = false;
//valid in PHP
$a[3] = 1;
?>
See also Autovivification from false.
1.2.448.2. Connex PHP features¶
1.2.448.2.1. Suggestions¶
Change the typehints from bool or false to array
Validate the type returned values of an functioncall before using it
1.2.448.2.2. Specs¶
Short name |
Php/FalseToArray |
Rulesets |
All, Analyze, Changed Behavior, CompatibilityPHP81, CompatibilityPHP82, LintButWontExec |
Exakat since |
2.3.0 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Note |
This issue may lint but will not run |
Available in |