vsprint() Requires An Array¶
vsprint() used to skip argument type validation, and wrongly report missing arguments, while that argument was not a array. Since PHP 8.0, the error message is clear.
PHP code¶
<?php
print vsprintf('%04d-%02d-%02d', 1);
vprintf('%04d-%02d-%02d', 1);
?>
Before¶
vsprintf(): Too few arguments
After¶
vsprintf(): Argument #2 ($values) must be of type array, int given
PHP version change¶
This behavior changed in 8.0