Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Sep 13, 2004, 00:20   #1
ArticleBot
SitePoint Articles
 
ArticleBot's Avatar
 
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"
ArticleBot is offline   Reply With Quote
Old Sep 13, 2004, 00:20   #2
Dangermouse
SitePoint Wizard
 
Dangermouse's Avatar
 
Join Date: Oct 2003
Posts: 1,078
Another great tutorial Harry, thanks!
Dangermouse is offline   Reply With Quote
Old Sep 13, 2004, 09:22   #3
DougBTX
SitePoint Wizard
 
DougBTX's Avatar
 
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.
DougBTX is offline   Reply With Quote
Old Sep 13, 2004, 10:08   #4
Hartmann
chown linux:users\ /world
SitePoint Award Recipient
 
Hartmann's Avatar
 
Join Date: Aug 2000
Location: Houston, TX, USA
Posts: 6,417
Great write up Harry! I'd love to see more about Iterators!!
Hartmann is offline   Reply With Quote
Old Sep 13, 2004, 12:02   #5
Big Fat Bob
Non-Member
 
Big Fat Bob's Avatar
 
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.
Big Fat Bob is offline   Reply With Quote
Old Sep 14, 2004, 17:10   #6
Ren
SitePoint Guru
 
Ren's Avatar
 
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.

Ren is online now   Reply With Quote
Old Sep 14, 2004, 18:06   #7
DougBTX
SitePoint Wizard
 
DougBTX's Avatar
 
Join Date: Nov 2001
Location: Bath, UK
Posts: 2,532
Quote:
Originally Posted by Ren
Similarly DOMList seems suitable for an ArrayAccess interface.
Well.. PHP is open source!

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.
DougBTX is offline   Reply With Quote
Old Sep 15, 2004, 00:44   #8
Mike
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.
  Reply With Quote
Old Dec 20, 2004, 06:58   #9
Richard Quadling
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).
  Reply With Quote
Old Apr 24, 2005, 04:52   #10
BerislavLopac
SitePoint Guru
 
BerislavLopac's Avatar
 
Join Date: Sep 2004
Location: Zagreb, Croatia
Posts: 846
Quote:
Originally Posted by DougBTX
Would be nice to adapt the Eclipse library to use SPL. DatabaseIterator is something I want to use...
ADOdb already has it -- you can foreach an ADORecordSet object with PHP5.
BerislavLopac is offline   Reply With Quote
Old Apr 25, 2005, 20:33   #11
Dylan B
Sitepоint Ninja
 
Dylan B's Avatar
 
Join Date: Jul 2004
Location: NYC
Posts: 1,155
Very informative
Dylan B is offline   Reply With Quote
Old Jun 8, 2005, 12:50   #12
Joe Crawford
SitePoint Community Guest
 
Posts: n/a
great article, especially since the docs are hotrrid ;) i think someone needs to help marcus with the docs ;)
  Reply With Quote
Old Feb 10, 2008, 10:37   #13
whisher
SitePoint Addict
 
whisher's Avatar
 
Join Date: May 2006
Location: Kakiland
Posts: 391
Thanks just a lot ;)
Bye.
whisher is offline   Reply With Quote
Old Feb 15, 2008, 22:50   #14
wen dxing
SitePoint Community Guest
 
Posts: n/a
a good article.Thanks
  Reply With Quote
Old Feb 16, 2008, 00:00   #15
CoderMaya
Coding and Breathing
 
CoderMaya's Avatar
 
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.
CoderMaya is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 17:41.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved