Req #74837 [NEW]: Request: DOMNodeList should implement Countable starting in php 7.2 (or php 8?)

From: Date: Fri, 30 Jun 2017 21:47:49 +0000
Subject: Req #74837 [NEW]: Request: DOMNodeList should implement Countable starting in php 7.2 (or php 8?)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209747@lists.php.net to get a copy of this message
From: tandre at themeetgroup dot com Operating system: PHP version: 7.2.0alpha2 Package: DOM XML related Bug Type: Feature/Change Request Bug description:Request: DOMNodeList should implement Countable starting in php 7.2 (or php 8?) 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 bug report at https://bugs.php.net/bug.php?id=74837&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74837&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74837&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74837&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74837&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74837&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74837&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74837&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74837&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74837&r=support Expected behavior: https://bugs.php.net/fix.php?id=74837&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74837&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74837&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74837&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74837&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74837&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74837&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74837&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74837&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74837&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74837&r=mysqlcfg

« previous php.bugs (#209747) next »