Req #74837 [Opn->Csd]: Request: DOMNodeList should implement Countable starting in php 7.2 (or php 8?)
| From: | remi@php.net | Date: | Mon, 10 Jul 2017 06:50:52 +0000 |
| Subject: | Req #74837 [Opn->Csd]: Request: DOMNodeList should implement Countable starting in php 7.2 (or php 8?) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209952@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74837&edit=1
ID: 74837
Updated by: remi@php.net
Reported by: tandre at themeetgroup dot com
Summary: Request: DOMNodeList should implement Countable
starting in php 7.2 (or php 8?)
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: DOM XML related
PHP Version: 7.2.0alpha2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f97fb47ca31681670bf5ac4b2f8ea4f3a47a3cd
Log: Fixed bug #74837 - NEWS
Previous Comments:
------------------------------------------------------------------------
[2017-06-30 21:47:44] tandre at themeetgroup dot com
Description:
------------
See https://secure.php.net/domnodelist - It's
surprising that it isn't Countable, and it should be fairly easy to do.
It has a
length property already, and is a type of list.
Code using count($domNodeList) would start emitting notices in php 7.2, and currently
the default count is unintuitive.
In php 7.2.0alpha1, and 7.1, and any other version:
```
php > $x = new Domnodelist();
php > echo count($x);
Warning: count(): Parameter must be an array or an object that implements Countable in php shell
code on line 1
1
```
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74837&edit=1