1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/reflection/tests/bug62715.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

26 lines
739 B
PHP

--TEST--
Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result)
--FILE--
<?php
function test(?PDO $a = null, $b = 0, array $c) {}
$r = new ReflectionFunction('test');
foreach ($r->getParameters() as $p) {
var_dump($p->isDefaultValueAvailable());
}
foreach ($r->getParameters() as $p) {
if ($p->isDefaultValueAvailable()) {
var_dump($p->getDefaultValue());
}
}
?>
--EXPECTF--
Deprecated: test(): Optional parameter $a declared before required parameter $c is implicitly treated as a required parameter in %s on line %d
Deprecated: test(): Optional parameter $b declared before required parameter $c is implicitly treated as a required parameter in %s on line %d
bool(false)
bool(false)
bool(false)