Doc #74048 [Ver]: Should explain how Collator::create() compares to new Collator()
| From: | cmb@php.net | Date: | Thu, 04 Mar 2021 13:01:15 +0000 |
| Subject: | Doc #74048 [Ver]: Should explain how Collator::create() compares to new Collator() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18617@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74048&edit=1
ID: 74048
Updated by: cmb@php.net
Reported by: teo8976 at gmail dot com
Summary: Should explain how Collator::create() compares to
new Collator()
Status: Verified
Type: Documentation Problem
Package: intl
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Without having a closer look, the difference is that the function
and static method return NULL on failure, while the constructor
returns an "empty" object in that case (cf. the return value
sections). The latter would be pretty uncommon, since
constructors usually throw on failure, but changing this would be
a BC break (if the docs are correct in this regard).
Anyhow, it might be beneficial to actually merge the different
pages.
Previous Comments:
------------------------------------------------------------------------
[2017-02-05 18:30:12] teo8976 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/collator.create
---
Collator has a constructor and a static create() method.
No clue is given in the documentaion about why one should use "Collator::create()" rather
than the constructor "new Collator()". If thery are completely equivalent then it must be
stated explicitly.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74048&edit=1