-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Implement Countable for DomNodeList and DOMNamedNodeMap (Request #74837) #2618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ext/dom/php_dom.c
Outdated
@@ -707,6 +707,7 @@ PHP_MINIT_FUNCTION(dom) | |||
dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL); | |||
dom_nodelist_class_entry->get_iterator = php_dom_get_iterator; | |||
zend_class_implements(dom_nodelist_class_entry, 1, zend_ce_traversable); | |||
zend_class_implements(dom_nodelist_class_entry, 1, zend_ce_countable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to call zend_class_implements once only ...
ext/dom/namednodemap.c
Outdated
RETURN_FALSE; | ||
} | ||
|
||
RETURN_LONG(count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is not right here. You're returning a zval *
as a zend_long
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you probably want to do is just pass return_value
as the second argument to dom_namednodemap_length_read
.
ext/dom/namednodemap.c
Outdated
} | ||
|
||
intern = Z_DOMOBJ_P(id); | ||
if(dom_namednodemap_length_read(intern, &count)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should compare against SUCCESS or FAILURE.
I believe this does not require an RFC. Can we get an opinion from @sgolemon and @remicollet on landing this in 7.2? |
I agree
LGTM |
Thanks for your contribution. Squashed and Merged. |
@remicollet May you change my name in the NEWS file from "Andreas Treichel" to "blar"? |
Excerpt from the release news: Version 10.37 26-May-2021 ------------------------- A few more bug fixes and tidies. The only change of real note is the removal of the actual POSIX names regcomp etc. from the POSIX wrapper library because these have caused issues for some applications (see 10.33 #2 below). Version 10.36 04-December-2020 ------------------------------ Again, mainly bug fixes and tidies. The only enhancements are the addition of GNU grep's -m (aka --max-count) option to pcre2grep, and also unifying the handling of substitution strings for both -O and callouts in pcre2grep, with the addition of $x{...} and $o{...} to allow for characters whose code points are greater than 255 in Unicode mode. NOTE: there is an outstanding issue with JIT support for MacOS on arm64 hardware. For details, please see Bugzilla issue #2618. Signed-off-by: Anatol Belski <[email protected]>
Implement the Interface Countable for DomNodeList and DOMNamedNodeMap (Request #74837)
Does this require a RFC?