Skip to content

Commit 6f8cb61

Browse files
phpstan-botclaude
authored andcommitted
Match a named argument for a negative position in the native getArgByPositionOrName()
The PHP method still finds an argument passed by name when the position is negative; the C++ mirror returned null early. Comparing the hash key as zend_ulong keeps exact parity with $i === $position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6523bc8 commit 6f8cb61

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎turbo-ext/src/ArgumentsNormalizer.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ PT_MINIT_REGISTRATION(pt_register_arguments_normalizer)
881881
Z_PARAM_LONG(position)
882882
Z_PARAM_STR(name)
883883
ZEND_PARSE_PARAMETERS_END();
884-
zend_object *arg = position < 0 ? NULL : phpstanturbo::visitors::argForParameter(args, (zend_ulong) position, ZSTR_VAL(name), ZSTR_LEN(name));
884+
zend_object *arg = phpstanturbo::visitors::argForParameter(args, (zend_ulong) position, ZSTR_VAL(name), ZSTR_LEN(name));
885885
if (arg == NULL) RETURN_NULL();
886886
RETURN_OBJ_COPY(arg);
887887
});

0 commit comments

Comments
 (0)