#45582 [NEW]: Countable interface dosen't work as expected
| From: | m dot golivkin at gmail dot com | Date: | Mon, 21 Jul 2008 14:53:06 +0000 |
| Subject: | #45582 [NEW]: Countable interface dosen't work as expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-127063@lists.php.net to get a copy of this message | ||
From: m dot golivkin at gmail dot com
Operating system: CentOS release 4.6 (Final)
PHP version: 5.2.6
PHP Bug Type: SPL related
Bug description: Countable interface dosen't work as expected
Description:
------------
Countable interface dosen't work on server A with php 5.2.6 on CentOS as
with server B with php 5.2.1 on Ubuntu 7.04.
link to phpinfo on server A:
http://www.asmeniniai-finansai.lt/phpinfo.php
Reproduce code:
---------------
<?php
error_reporting(E_ALL | E_STRICT);
class Foo implements Countable
{
public function count()
{
return 4;
}
}
$foo = new Foo();
var_dump(count($foo), $foo->count());
?>
Expected result:
----------------
int(4)
int(4)
Actual result:
--------------
int(1)
int(4)
--
Edit bug report at http://bugs.php.net/?id=45582&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45582&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45582&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45582&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45582&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45582&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45582&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45582&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45582&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45582&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45582&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45582&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45582&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45582&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45582&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45582&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45582&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45582&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45582&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45582&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45582&r=mysqlcfg