ID:               35734
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dpantel at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         SPL related
 Operating System: RHES (linux 2.4.21-37)
 PHP Version:      5.1.1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Those are class constants now:

RecursiveIteratorIterator::SELF_FIRST



Previous Comments:
------------------------------------------------------------------------

[2005-12-19 16:27:39] dpantel at gmail dot com

Description:
------------
RecursiveIteratorIterator constructor fails to recognize mode
constants.

The constructor works fine when passed only a RecursiveIterator object.
 It also functions correctly if passed a RecursiveIterator object and an
integer (0,1,2, etc) as the second (mode) argument.  However, if one
attempts to pass a documented constant keyword (RIT_SELF_FIRST or
SELF_FIRST), the constructor fails.

Note: different documentations show different constant definitions
(RIT_SELF_FIRST vs SELF_FIRST). I have tried both, and neither one
works.

Reproduce code:
---------------
class Rit implements RecursiveIterator {...}

$test = new Rit();

//work fine
$rii = new RecursiveIteratorIterator($test);
$rii = new RecursiveIteratorIterator($test, 1);

//do not work
$rii = new RecursiveIteratorIterator($test, RIT_SELF_FIRST);
$rii = new RecursiveIteratorIterator($test, SELF_FIRST);

//even tried this, with no avail
$rii = new RecursiveIteratorIterator($test,
RecursiveIteratorIterator::RIT_SELF_FIRST);
$rii = new RecursiveIteratorIterator($test,
RecursiveIteratorIterator::SELF_FIRST);


Expected result:
----------------
A RecursiveIteratorIterator object

Actual result:
--------------
Notice: Use of undefined constant RIT_SELF_FIRST - assumed
'RIT_SELF_FIRST' in /www/rit.class.php on line 276

(or Notice: Use of undefined constant SELF_FIRST - assumed 'SELF_FIRST'
in /www/rit.class.php on line 276)


Fatal error: Uncaught exception 'InvalidArgumentException' with message
'An instance of RecursiveIterator or IteratorAggregate creating it is
required' in /www/rit.class.php:276 Stack trace: #0
/www/rit.class.php(276):
RecursiveIteratorIterator->__construct(Object(treeIterator),
'RIT_SELF_FIRST') ...


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35734&edit=1

Reply via email to