mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fixed bug #77931
This commit is contained in:
parent
fb4c811835
commit
cedee4408b
3
NEWS
3
NEWS
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
16
ext/standard/tests/array/bug77931.phpt
Normal file
16
ext/standard/tests/array/bug77931.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user