mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Update __toString() issues
This commit is contained in:
parent
dc6f211967
commit
5ae70cc44a
@ -24,7 +24,11 @@ class CachingIterator
|
||||
if ($this->more = $this->it->hasMore()) {
|
||||
$this->current = $this->it->current();
|
||||
$this->key = $this->it->key();
|
||||
$this->strvalue = (string)$this->current;
|
||||
if (is_object($this->current)) {
|
||||
$this->strvalue = $this->current->__toString();
|
||||
} else {
|
||||
$this->strvalue = (string)$this->current;
|
||||
}
|
||||
} else {
|
||||
$this->current = NULL;
|
||||
$this->key = NULL;
|
||||
|
@ -59,7 +59,6 @@ SPL_METHOD(RecursiveDirectoryIterator, next);
|
||||
SPL_METHOD(RecursiveDirectoryIterator, key);
|
||||
SPL_METHOD(RecursiveDirectoryIterator, hasChildren);
|
||||
SPL_METHOD(RecursiveDirectoryIterator, getChildren);
|
||||
SPL_METHOD(RecursiveDirectoryIterator, __toString);
|
||||
|
||||
|
||||
/* declare method parameters */
|
||||
@ -94,7 +93,6 @@ static zend_function_entry spl_ce_dir_tree_class_functions[] = {
|
||||
SPL_ME(RecursiveDirectoryIterator, key, NULL, ZEND_ACC_PUBLIC)
|
||||
SPL_ME(RecursiveDirectoryIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
|
||||
SPL_ME(RecursiveDirectoryIterator, getChildren, NULL, ZEND_ACC_PUBLIC)
|
||||
SPL_MA(RecursiveDirectoryIterator, __toString, DirectoryIterator, getPathname, NULL, ZEND_ACC_PUBLIC)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user