|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77895 IntlDateFormatter::create fails in strict mode if $locale = null
Submitted: 2019-04-15 11:51 UTC Modified: 2019-04-15 13:20 UTC
From: misley dot marton at webdream dot hu Assigned: nikic (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 7.2.17 OS: docker php:7.2-apache
Private report: No CVE-ID: None
 [2019-04-15 11:51 UTC] misley dot marton at webdream dot hu
In the docs it sais at parameters section:

"locale: Locale to use when formatting or parsing or NULL to use the value specified in the ini setting intl.default_locale."

If you try to use strict mode with locale = null, the script fails with

"PHP Fatal error:  Uncaught TypeError: IntlDateFormatter::create() expects parameter 1 to be string, null given in ..."

Test script:


$format =  $formatter = \IntlDateFormatter::create(null, \IntlDateFormatter::NONE, \IntlDateFormatter::NONE);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-15 11:53 UTC] misley dot marton at webdream dot hu
phpcode without the double assign



$formatter = \IntlDateFormatter::create(null, \IntlDateFormatter::NONE, \IntlDateFormatter::NONE);
 [2019-04-15 13:20 UTC]
-Assigned To: +Assigned To: nikic
 [2019-04-15 13:28 UTC]
Automatic comment on behalf of
Log: Fixed bug #77895
 [2019-04-15 13:28 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 05:01:30 2024 UTC