[wp-hackers] PHP Coding Practices

Mark Jaquith mark.wordpress at txfx.net
Wed Feb 15 04:19:39 GMT 2006

On Feb 14, 2006, at 9:14 PM, Dave Grijalva wrote:

> it may not be documented, but it's there.

I stand corrected.  Interesting that it's incorrectly documented.

> yes, this doesn't break iterating over an object, but it does break  
> creating
> an object that can be iterated elsewhere.  in PHP5, an iteratable  
> object
> should behave properly when used anywhere an array is expected.   
> typecasting
> would break this compatibility all over the wordpress core

We're not going to cast objects to array.  So there's no problem.   
We're not running foreach() loops on objects... only on arrays or  
queries that normally return arrays, but may return false (no  
results) instead.

ezSQL isn't going to start returning objects where it used to return  
arrays, so there is no issue of compatibility.
Mark Jaquith

More information about the wp-hackers mailing list