Incompatible error when not enough parameters passed
The error message in PHP core function is the same:
password_hash() expects at least 2 parameters, 0 given
In the backported function, there is something like this:
Missing argument 1....
This is not a major one, but still incompatible.
What I've done in backported function is that required arguments got a null default value (since type check is still necessary), so that I could trigger a proper error for less than enough argument count. The idea originates from ramsey/array_column.
This belongs to PHP core. It cannot (and probably shouldn't) be addressed from plain PHP code:
function foo($a, $b) {
}
foo();
Output for 4.3.0 - 5.0.5, 5.1.0 - 5.6.30, 7.0.0 - 7.0.18 Warning: Missing argument 1 for foo() Warning: Missing argument 2 for foo() Output for 7.1.0 - 7.1.4 Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed
https://3v4l.org/ElVGo
This belongs to PHP core. It cannot (and probably shouldn't) be addressed from plain PHP code:
Not true really. We could simulate what happens on the internal functions if we wanted to, I think.