summaryrefslogtreecommitdiff
path: root/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
blob: e3b5ad2deec525c69fbc0d321fe126c32675216a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Call internal function with incorrect number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
try {
    substr("foo");
} catch (ArgumentCountError $e) {
    echo get_class($e) . PHP_EOL;
    echo $e->getMessage() . PHP_EOL;
}

try {
    array_diff([]);
} catch (ArgumentCountError $e) {
    echo get_class($e) . PHP_EOL;
    echo $e->getMessage(), "\n";
}
?>
--EXPECT--
ArgumentCountError
substr() expects at least 2 arguments, 1 given
ArgumentCountError
At least 2 arguments are required, 1 given