diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index e459cce8cf9..fe5043e3758 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1458,9 +1458,11 @@ PHP_METHOD(RecursiveDirectoryIterator, hasChildren) bool allow_links = 0; spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(allow_links) + ZEND_PARSE_PARAMETERS_END(); + if (spl_filesystem_is_invalid_or_dot(intern->u.dir.entry.d_name)) { RETURN_FALSE; } else {