Search found 2 matches

by saberworks
Mon May 12, 2003 3:27 pm
Forum: PHP - Theory and Design
Topic: Iterator and SImpleIterator combined
Replies: 6
Views: 20055

It's better to work off what will happen MOST of the time (IMO). Instead of get_next(), use get() and it will get the next 'expected' just like mysql_fetch_array() or something. I think the problem is that many people over-think and over-engineer a solution.
by saberworks
Thu May 08, 2003 4:07 pm
Forum: PHP - Theory and Design
Topic: Iterator and SImpleIterator combined
Replies: 6
Views: 20055

Why even get that complicated? Why not just:

Code: Select all

<?php
$it = & new Iterator;
while($row = $it->get_next()) {
    echo $row['blah'];
}
?>