diff --git a/hphp/system/php/spl/iterators/RecursiveDirectoryIterator.php b/hphp/system/php/spl/iterators/RecursiveDirectoryIterator.php index 6f75b3f16..d2bceee95 100644 --- a/hphp/system/php/spl/iterators/RecursiveDirectoryIterator.php +++ b/hphp/system/php/spl/iterators/RecursiveDirectoryIterator.php @@ -75,7 +75,7 @@ class RecursiveDirectoryIterator extends FilesystemIterator if ($this->getFlags() & FilesystemIterator::CURRENT_AS_PATHNAME) { return $this->current(); } - $child = new self($this->getPathname(), $this->getFlags()); + $child = new static($this->getPathname(), $this->getFlags()); $child->subPath = $this->subPath; if ($child->subPath) { $child->subPath .= DIRECTORY_SEPARATOR; diff --git a/hphp/test/slow/ext_iterator/RecursiveDirectoryIterator_keep_class.php b/hphp/test/slow/ext_iterator/RecursiveDirectoryIterator_keep_class.php new file mode 100644 index 000000000..c521b107c --- /dev/null +++ b/hphp/test/slow/ext_iterator/RecursiveDirectoryIterator_keep_class.php @@ -0,0 +1,19 @@ +