- 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:
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;
}
--- /dev/null
+--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