Recently, during a Coding Standards discussion, someone came up with the idea of forbidden the compact() function. One of the arguments was that this function does not report undefined variables passed to it. After checking its implementation and documentation, nothing was founded justifying the reason of why this has been this way since ever.
This RFC proposes the addition of a notice in the compact() function when a not defined variable had been passed to it.
$foo = 'bar'; $baz = compact('foz'); // Notice: compact(): Undefined variable: foz
Undefined variables passed to compact() will now be reported as a notice.
The next PHP 7.x, current version 7.3.
This RFC has only impact in the compact() function.
Since this RFC contains a Backward Incompatible Change, 2/3 majority is required.
Voting starts on 2018-06-06 and ends on 2018-06-18 23:00 UTC.
The patch (including tests) for this proposal is available in GitHub Pull Request #3240.