#41975 [NEW]: SELF_FIRST constant missing
| From: | kevin at oceania dot net | Date: | Thu, 12 Jul 2007 07:04:06 +0000 |
| Subject: | #41975 [NEW]: SELF_FIRST constant missing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114956@lists.php.net to get a copy of this message | ||
From: kevin at oceania dot net
Operating system: linux
PHP version: 5CVS-2007-07-12 (snap)
PHP Bug Type: SPL related
Bug description: SELF_FIRST constant missing
Description:
------------
When calling parent::SELF_FIRST with recursiveDirectoryIterator fatal
error
Reproduce code:
---------------
<?php
class DirectoryTreeIterator extends RecursiveDirectoryIterator{
public function __construct($path) { parent::__construct(new
RecursiveCachingIterator(
new RecursiveDirectoryIterator($path,
RecursiveDirectoryIterator::KEY_AS_FILENAME),
CachingIterator::CALL_TOSTRING),
parent::SELF_FIRST);
}
public function current() {
$cur = "";
for( $i = 0; $i < $this->getDepth(); $i++)
{
$cur .= $this->getSubIterator($i)->hasNext() ? " | " : " ";
}
$i = $this->SubIterator($i);
return $cur . ($i->hasNext() ? " | - " : "/ - ").(string)$i;
}
} /*** end of class ***/
$obj = new DirectoryTreeIterator('albums');
Expected result:
----------------
directory list
Actual result:
--------------
Fatal error: Undefined class constant 'SELF_FIRST' in /www/web/test.php on
line 9
--
Edit bug report at http://bugs.php.net/?id=41975&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41975&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41975&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41975&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41975&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41975&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41975&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41975&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41975&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41975&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41975&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41975&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41975&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41975&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41975&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41975&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41975&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41975&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41975&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41975&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41975&r=mysqlcfg