SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: About PHP SPL

  1. #1
    Founder of Primal Skill Ltd. feketegy's Avatar
    Join Date
    Aug 2006
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question About PHP SPL

    Hello,
    I just read about Standard PHP Library and about iterators...
    I'd like to know more about SPL (the documentation is very limited)

    Why it is better (or good practice) to use it?

    And especially why it is better to use iterators rather than loops?

    Replies are welcome if anybody worked with PHP SPL before.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    Founder of Primal Skill Ltd. feketegy's Avatar
    Join Date
    Aug 2006
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    this recent article on the zend site might help you (and me).

  5. #5
    Founder of Primal Skill Ltd. feketegy's Avatar
    Join Date
    Aug 2006
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read the articles, but I still don't get it why it is better to use for ex. iterators?

  6. #6
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by feketegy View Post
    And especially why it is better to use iterators rather than loops?
    SPL iterators are not the pure ones, like e.g. in ruby, they are used together with loops, not instead of them. The purpose of Iterator is to allow using "foreach" with different kinds of sequences, no matter how exactly these are built.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •