访问PHP 5.2.17中的Iterator接口

Currently we have to use PHP 5.2. Yes, I know I ought to upgrade to 5.3 or 5.4 but, in the meantime:

I'm trying to write my own class that implements the Iterator interface. However, the class cannot be found, apparently because the Iterator interface is not loaded. However, SPL is loaded which I thought was sufficient.

Any suggestions? Doubtless I've missed something stupid...

Thanks in advance.

The iterator is not a class, it's an interface:

class Yourclass implements Iterator {

  // Methods here

}

If this didn't solve the issue, you should consider actually including some code in your question.

It looks like an old bug (not fixed) when using turkish locale : https://bugs.php.net/bug.php?id=18556

If so, try using another locale.