This commit is contained in:
Nikita Popov 2019-04-23 11:40:13 +02:00
parent fb4c811835
commit cedee4408b
3 changed files with 20 additions and 1 deletions

3
NEWS
View File

@ -8,6 +8,9 @@ PHP NEWS
- Session:
. Fixed bug #77911 (Wrong warning for session.sid_bits_per_character). (cmb)
- Standard:
. Fixed bug #77931 (Warning for array_map mentions wrong type). (Nikita)
02 May 2019, PHP 7.3.5
- Core:

View File

@ -6158,7 +6158,7 @@ PHP_FUNCTION(array_map)
for (i = 0; i < n_arrays; i++) {
if (Z_TYPE(arrays[i]) != IS_ARRAY) {
php_error_docref(NULL, E_WARNING, "Expected parameter %d to be an array, %s given", i + 2, zend_zval_type_name(&arrays[0]));
php_error_docref(NULL, E_WARNING, "Expected parameter %d to be an array, %s given", i + 2, zend_zval_type_name(&arrays[i]));
efree(array_pos);
return;
}

View File

@ -0,0 +1,16 @@
--TEST--
Bug #77931: Warning for array_map mentions wrong type
--FILE--
<?php
array_map('trim', array(), 1);
array_map('trim', array(), array(), true);
array_map('trim', array(), array(), array(), null);
?>
--EXPECTF--
Warning: array_map(): Expected parameter 3 to be an array, int given in %s on line %d
Warning: array_map(): Expected parameter 4 to be an array, bool given in %s on line %d
Warning: array_map(): Expected parameter 5 to be an array, null given in %s on line %d