-
-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
These errors below looks strange:
40) Warning
Incompatible signature for PHP >= 8:
- mb_ucfirst(string $string, ?string $encoding = null): string
+ mb_ucfirst(string $string, ?string $encoding = null): string
41) Warning
Incompatible signature for PHP >= 8:
- mb_lcfirst(string $string, ?string $encoding = null): string
+ mb_lcfirst(string $string, ?string $encoding = null): string
Internal functions up to PHP 8.0 implicitly accepted null
as a string
. It seems that the type is declared as ?string
instead of string
for compatibility in polyfills up to php80.
polyfill/src/Util/TestListenerTrait.php
Lines 126 to 136 in df4793d
$map = [ | |
'?' => '', | |
'IDNA_DEFAULT' => \PHP_VERSION_ID >= 80100 ? 'IDNA_DEFAULT' : '0', | |
'array|string|null $string' => 'array|string $string', | |
'array|string|null $from_encoding = null' => 'array|string|null $from_encoding = null', | |
'array|string|null $from_encoding' => 'array|string $from_encoding', | |
]; | |
if (strtr($polyfillSignature, $map) !== $originalSignature) { | |
$warnings[] = TestListener::warning("Incompatible signature for PHP >= 8:\n- {$f['name']}$originalSignature\n+ {$f['name']}$polyfillSignature"); | |
} |
In the code below, ?
is removed to check the difference between the internal function and the polyfill interface.
PHP 8.4 deprecates implicit nullable, so this test should be replaced with more stringent checks.
refs #471 (comment)
Metadata
Metadata
Assignees
Labels
No labels