[php-src] Issue #8446: new Collator(null) should not trigger a deprecation warning
| From: | claudepache | Date: | Wed, 27 Apr 2022 09:39:43 +0000 |
| Subject: | [php-src] Issue #8446: new Collator(null) should not trigger a deprecation warning | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241276@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8446
Author: claudepache
### Description
The following code:
```php
<?php
new Collator(null);
```
Resulted in this output:
```
Deprecated: Collator::__construct(): Passing null to parameter #1 ($locale) of type string is
deprecated in /in/AUfEa on line 2
```
However, [the documentation says](https://www.php.net/manual/en/collator.construct.php): “if null
is passed for the locale, the default locale's collation rules will be used”.
Therefore, I expect that the
$locale parameter is nullable, and no deprecation warning
is triggered.
(Alternatively, in case "" has the same effect of what is currently
documented for null, the documentation may be amended.)
### PHP Version
PHP 8.1.5
### Operating System
_No response_