xref: /PHP-8.3/ext/standard/tests/array/bug77931.phpt (revision 7936c808)
1--TEST--
2Bug #77931: Warning for array_map mentions wrong type
3--FILE--
4<?php
5
6try {
7    array_map('trim', array(), 1);
8} catch (TypeError $e) {
9    echo $e->getMessage(), "\n";
10}
11try {
12    array_map('trim', array(), array(), true);
13} catch (TypeError $e) {
14    echo $e->getMessage(), "\n";
15}
16try {
17    array_map('trim', array(), array(), array(), null);
18} catch (TypeError $e) {
19    echo $e->getMessage(), "\n";
20}
21
22?>
23--EXPECT--
24array_map(): Argument #3 must be of type array, int given
25array_map(): Argument #4 must be of type array, true given
26array_map(): Argument #5 must be of type array, null given
27