1--TEST--
2Call userland function with incorrect number of arguments
3--FILE--
4<?php
5try {
6    function foo($bar) { }
7    foo();
8} catch (\Error $e) {
9    echo get_class($e) . PHP_EOL;
10    echo $e->getMessage() . PHP_EOL;
11}
12
13try {
14    function bar($foo, $bar) { }
15    bar(1);
16} catch (\Error $e) {
17    echo get_class($e) . PHP_EOL;
18    echo $e->getMessage() . PHP_EOL;
19}
20
21function bat(int $foo, string $bar) { }
22
23try {
24    bat(123);
25} catch (\Error $e) {
26    echo get_class($e) . PHP_EOL;
27    echo $e->getMessage() . PHP_EOL;
28}
29
30try {
31    bat("123");
32} catch (\Error $e) {
33    echo get_class($e) . PHP_EOL;
34    echo $e->getMessage() . PHP_EOL;
35}
36?>
37--EXPECTF--
38ArgumentCountError
39Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
40ArgumentCountError
41Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
42ArgumentCountError
43Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
44ArgumentCountError
45Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
46