[php-src] Issue #8115: Could not catch deprecation notice from IntlDateFormatter()
| From: | xmav | Date: | Fri, 18 Feb 2022 03:40:35 +0000 |
| Subject: | [php-src] Issue #8115: Could not catch deprecation notice from IntlDateFormatter() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239862@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8115
Author: xmav
### Description
The following code:
```php
error_reporting(E_ALL);
set_error_handler(function ($errNo, $errStr) {echo 'Handle ' . $errStr;});
str_contains("test", null);
new \IntlDateFormatter('en_US', 0, null);
<?php
```
Resulted in this output:
```
Handle str_contains(): Passing null to parameter #2 ($needle) of type string is deprecatedPHP
Deprecated: IntlDateFormatter::__construct(): Passing null to parameter #3 ($timeType) of type int
is deprecated in /Users/maxim/ws/magento2ce/debug/dep.php on line 5
Deprecated: IntlDateFormatter::__construct(): Passing null to parameter #3 ($timeType) of type int
is deprecated in /Users/maxim/ws/magento2ce/debug/dep.php on line 5
```
But I expected this output instead:
```
Handle str_contains(): Passing null to parameter #2 ($needle) of type string is deprecatedPHP
Deprecated: IntlDateFormatter::__construct(): Passing null to parameter #3 ($timeType) of type int
is deprecated in /Users/maxim/ws/magento2ce/debug/dep.php on line 5
Handle IntlDateFormatter::__construct(): Passing null to parameter #3 ($timeType) of type int is
deprecated in /Users/maxim/ws/magento2ce/debug/dep.php on line 5
```
### PHP Version
PHP 8.1.0
### Operating System
_No response_