Edit report at https://bugs.php.net/bug.php?id=81606&edit=1
ID: 81606
Patch added by: cedric.anne@gmail.com
Reported by: cedric dot anne at gmail dot com
Summary: Mistyped IntlDateFormatter::__construct() arguments
Status: Open
Type: Bug
Package: I18N and L10N related
Operating System: Ubuntu
PHP Version: 8.1.0RC5
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix IntlDateFormatter constructor documentation
On GitHub: https://github.com/php/doc-en/pull/1086
Patch: https://github.com/php/doc-en/pull/1086.patch
Previous Comments:
------------------------------------------------------------------------
[2021-11-10 20:59:26] cedric dot anne at gmail dot com
The following pull request has been associated:
Patch Name: Fix expected type of IntlDateFormatter::__construct() arguments
On GitHub: https://github.com/php/php-src/pull/7640
Patch: https://github.com/php/php-src/pull/7640.patch
------------------------------------------------------------------------
[2021-11-10 20:07:24] cedric dot anne at gmail dot com
Description:
------------
According to PHP documentation, arguments $dateType and $timeType of
IntlDateFormatter::__construct() should accept null values.
On PHP 8.1, when using null values, a deprecation error is triggered:
> PHP Deprecated: IntlDateFormatter::__construct(): Passing null to parameter #2 ($dateType) of
> type int is deprecated
Test script:
---------------
<?php
$formatter = new IntlDateFormatter('de_DE', 'Europe/Berlin', null, null,
'dd-MM');
echo $formatter->format(new DateTime('2012-07-02T22:44:03Z'));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81606&edit=1