Bug #61808 [NEW]: Could not implement interface Iterator

From: Date: Sun, 22 Apr 2012 05:29:01 +0000
Subject: Bug #61808 [NEW]: Could not implement interface Iterator
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-169848@lists.php.net to get a copy of this message
From:             
Operating system: Fedora 17 x86_64
PHP version:      5.4.0
Package:          Class/Object related
Bug Type:         Bug
Bug description:Could not implement interface Iterator

Description:
------------
I cannot find anything within changelogs, bug reportings and documentations

relating to this issue.

It works fine in php 5.3.10, but gives me fatal error in PHP 5.4.

Test script:
---------------
<?php
error_reporting(E_ALL | E_DEPRECATED | E_STRICT);
ini_set('display_errors', 1);

interface Foo_SQL_Interface_Result extends ArrayAccess, Countable,
Iterator
{
 public function data_seek($offset);
 public function fetch_all($resulttype=MYSQLI_NUM);
 public function fetch_array();
 public function fetch_assoc();
 public function fetch_field_direct($offset);
 public function fetch_field();
 public function fetch_fields();
 public function fetch_object();
 public function fetch_row();
 public function field_seek($offset);
 public function free();
}

class Foo_MySQLi_UseResult extends MySQLi_Result
{
 function __construct(MySQLi $obj) { parent::__construct($obj); }
 public function fetch_array($type_cast=false) {}
 public function fetch_assoc($type_cast=false) {}
 public function fetch_row($type_cast=false) {}
 public function fetch_all($resulttype=MYSQLI_ASSOC, $type_cast=false) {}
}

class Foo_MySQLi_Result extends Foo_MySQLi_UseResult implements
Foo_SQL_Interface_Result
{
 public function data_seek($offset) {}
 public function fetch_field_direct($offset) {}
 public function field_seek($offset) {}
 # ArrayAccess
 public function offsetExists($k)  {}
 public function offsetGet($k)     {}
 public function offsetSet($k, $v) {}
 public function offsetUnset($k)   {}
 # Countable
 public function count()   {}
 # Iterator
 public function key()     {}
 public function current() {}
 public function next()    {}
 public function rewind()  {}
 public function valid()   {}
}


Actual result:
--------------
Fatal error: Class Foo_MySQLi_Result could not implement interface Iterator
in 
Unknown on line 0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61808&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=61808&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=61808&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=61808&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=61808&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61808&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=61808&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=61808&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=61808&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=61808&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=61808&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=61808&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=61808&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=61808&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=61808&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=61808&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61808&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=61808&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=61808&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=61808&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=61808&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=61808&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#169848) next »