|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-12 09:11 UTC] helly@php.net
[2007-07-12 10:07 UTC] kevin at oceania dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 02:00:01 2025 UTC |
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