php-src/Zend/tests/required_param_after_optional_named_args.phpt
Máté Kocsis 2079da0158
Fix #13865 Improve parameter and return value related deprecation messages (#13913)
I added the function/method name to some compile-time deprecation messages which are related to parameters/return values. Consistently with the other similar error messages, I included the function/method name at the start of the message.
2024-04-08 22:20:32 +02:00

18 lines
412 B
PHP

--TEST--
Optional param before required should be treated as required for named args as well
--FILE--
<?php
function test($a = 1, $b) {
}
try {
test(b: 2);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: test(): Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in %s on line %d
test(): Argument #1 ($a) not passed