|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Articles
Join Date: Apr 2001
Posts: 0
|
Article Discussion
This is an article discussion thread for discussing the SitePoint article, "Introducing PHP 5's Standard Library"
|
|
|
|
|
|
#2 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2003
Posts: 1,078
|
Another great tutorial Harry, thanks!
|
|
|
|
|
|
#3 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
|
Here's a way to do the Observer pattern without multiple inheritance:
http://blogs.teamb.com/joannacarter/articles/690.aspx (Note, this is an article on Delphi, not PHP, but the ideas translate because we have interfaces now in PHP5) Good article ![]() Would be nice to adapt the Eclipse library to use SPL. DatabaseIterator is something I want to use... Douglas Last edited by DougBTX; Sep 13, 2004 at 12:35. |
|
|
|
|
|
#4 |
|
chown linux:users\ /world
![]() ![]() Join Date: Aug 2000
Location: Houston, TX, USA
Posts: 6,417
|
Great write up Harry! I'd love to see more about Iterators!!
![]() |
|
|
|
|
|
#5 |
|
Non-Member
![]() Join Date: Sep 2004
Location: United Kingdom (Come)
Posts: 80
|
Yo Doug,
Thanks for the link, have now added it to my favourites ![]() Btw, there is another link at this blog on Iterators, apparently both articles were written for a future book. |
|
|
|
|
|
#6 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: UK
Posts: 931
|
Just wish SPL was more integrated with the rest of PHP. Both SQLiteResult and SQLiteUnbuffered do not implement the Iterator interface. So can not pass them to function with type-checking, like a subclass of FilterIterator. Even thou can use foreach() on both. So have roll a wrapper to get interface. Similarly DOMList seems suitable for an ArrayAccess interface. |
|
|
|
|
|
#7 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
|
Quote:
I do agree with your point though, SPL is underused atm. I'd like to see more done with it than just Iterators, though even just that is nice I've got my QueryIterator working too ![]() Douglas Last edited by DougBTX; Dec 20, 2004 at 12:44. |
|
|
|
|
|
|
#8 |
|
SitePoint Community Guest
Posts: n/a
|
Cool article Harry; I knew about Iterator and IteratorAggregate, but not the others.
I can just see inexperienced scripters getting seriously confused though; when they see an object being accessed with an array syntax, only to try it themselves and not being able to get it to work. |
|
|
|
#9 |
|
SitePoint Community Guest
Posts: n/a
|
Accessing objects as arrays can be a little confusing. Except if you use Delphi!
contents of a container can be accessed as an array. Form.StringList.Items[2] (I think is) the same as Form.StringList.Items.GetItem(2) The '.' in Delphi is the same as '->' in PHP. I like the idea, but my lack of experience confuses me with knowing when I should use them. I want container/component classes. (Table/Columns). |
|
|
|
#10 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Zagreb, Croatia
Posts: 846
|
Quote:
|
|
|
|
|
|
|
#11 |
|
Sitepоint Ninja
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: NYC
Posts: 1,155
|
Very informative
![]() |
|
|
|
|
|
#12 |
|
SitePoint Community Guest
Posts: n/a
|
great article, especially since the docs are hotrrid ;) i think someone needs to help marcus with the docs ;)
|
|
|
|
#13 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: May 2006
Location: Kakiland
Posts: 391
|
Thanks just a lot ;)
Bye. |
|
|
|
|
|
#14 |
|
SitePoint Community Guest
Posts: n/a
|
a good article.Thanks
|
|
|
|
#15 |
|
Coding and Breathing
![]() ![]() ![]() ![]() Join Date: Feb 2008
Location: Atlit, Israel
Posts: 470
|
Yeah iterators aren't such a huge deal in my opinion.
In C# I had to use them for the MCPD cert. tests and also use object indexers and all that stuff... But I never seen myself actually choosing to work with them. I don't see a necessity for them in any common case. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 17:41.













Linear Mode
