note 125463 added to function.is-countable
| From: | info at ensostudio dot ru | Date: | Sun, 25 Oct 2020 18:29:26 +0000 |
| Subject: | note 125463 added to function.is-countable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215650@lists.php.net to get a copy of this message | ||
Note: if is_countable() return true is does not guarantee that the it can be calculated recursively
and correctly:
<?php
$iterator = new ArrayIterator(['one', 'two', new
ArrayIterator(['three', 'four'])]);
var_dump(is_countable($iterator), count($iterator, COUNT_RECURSIVE));
// return TRUE and 3!
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.174 (proxied: 31.129.215.166)
----
Manual Page -- http://php.net/manual/en/function.is-countable.php
Edit -- https://master.php.net/note/edit/125463
Del: integrated -- https://master.php.net/note/delete/125463/integrated
Del: useless -- https://master.php.net/note/delete/125463/useless
Del: bad code -- https://master.php.net/note/delete/125463/bad+code
Del: spam -- https://master.php.net/note/delete/125463/spam
Del: non-english -- https://master.php.net/note/delete/125463/non-english
Del: in docs -- https://master.php.net/note/delete/125463/in+docs
Del: other reasons-- https://master.php.net/note/delete/125463
Reject -- https://master.php.net/note/reject/125463
Search -- https://master.php.net/manage/user-notes.php