From:             Peter dot Albertsson at naturesown dot se
Operating system: SuSE Linux 9.1
PHP version:      5.0.3
PHP Bug Type:     SPL related
Bug description:  RecursiveIteratorIterator is not general enough

Description:
------------
The RecursiveIteratorIterator is not flexible enough when it comes to
iterating trees. I also find some modes it operates in unneccasary.

I would like to choose in which directions the iterator iterates through
trees:

1. Depth first or
2. Breadth first

combined with one of:

1. Left to right
2. Right to left

As the iterator is implemented today, it lacks the method of iterating
breadth first. Instead I'm giving these options:

 - RIT_LEAVES_ONLY: very easy to implement by oneself, by checking if the
node is a leaf node.
 - RIT_SELF_FIRST: This one I would consider the default option. but it is
not.
 - RIT_CHILD_FIRST: OK.. got to admit that I don't even understand this
one...

Most importantly, and I repeat, it lacks the option to iterate breadth
first, which is required by many standard algorithms.

Best Regards,

  Peter Albertsson


-- 
Edit bug report at http://bugs.php.net/?id=32439&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32439&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32439&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32439&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32439&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32439&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32439&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32439&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32439&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32439&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32439&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32439&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32439&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32439&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32439&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32439&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32439&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32439&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32439&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32439&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32439&r=mysqlcfg

Reply via email to