Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ ZEND_METHOD(ReflectionParameter, __construct)
case IS_OBJECT: {
ce = Z_OBJCE_P(reference);

if (instanceof_function(ce, zend_ce_closure)) {
if (ce == zend_ce_closure) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to add a comment just to explain it. As instanceof_function() is always inlined to do this pointer comparison and only call the outlined slow function if not true.

fptr = (zend_function *)zend_get_closure_method_def(Z_OBJ_P(reference));
Z_ADDREF_P(reference);
is_closure = true;
Expand Down Expand Up @@ -2840,7 +2840,7 @@ ZEND_METHOD(ReflectionParameter, allowsNull)
}
/* }}} */

/* {{{ Returns whether this parameters is passed to by reference */
/* {{{ Returns whether this parameter is passed to by reference */
ZEND_METHOD(ReflectionParameter, isPassedByReference)
{
reflection_object *intern;
Expand Down