Bug #75668 [Csd->Nab]: count function accuses that could not count an ArrayObject
| From: | requinix@php.net | Date: | Tue, 12 Dec 2017 04:03:11 +0000 |
| Subject: | Bug #75668 [Csd->Nab]: count function accuses that could not count an ArrayObject | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213064@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75668&edit=1
ID: 75668
Updated by: requinix@php.net
Reported by: carusogabriel34 at gmail dot com
Summary: count function accuses that could not count an
ArrayObject
-Status: Closed
+Status: Not a bug
Type: Bug
Package: SPL related
Operating System: Ubuntu 14.04.5 LTS
PHP Version: 7.2.0
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2017-12-12 03:55:10] carusogabriel34 at gmail dot com
Close due impracticable.
------------------------------------------------------------------------
[2017-12-12 03:54:18] carusogabriel34 at gmail dot com
Strange. I've use empty instead and works. Gonna close it, and if it show up again, I report
it. Thanks!
------------------------------------------------------------------------
[2017-12-12 03:49:31] requinix@php.net
That works too. https://3v4l.org/OZQGr
------------------------------------------------------------------------
[2017-12-12 03:46:14] carusogabriel34 at gmail dot com
Sorry requinix@php.net, this was my first bug report. Here's the code;
<?php
class Foo {
protected $emailLog;
public function initialize() {
$this->emailLog = new ArrayObject;
}
public function summary() {
return count($this->emailLog) === 0
? ''
: count($this->emailLog);
}
}
$log = new Foo;
$log->initialize();
$log->summary();
?>
------------------------------------------------------------------------
[2017-12-12 03:27:22] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Works for me. https://3v4l.org/lKNqU
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=75668
--
Edit this bug report at https://bugs.php.net/bug.php?id=75668&edit=1