Skip to content

Stdlib: abs/floor/ceil Reflection/named param num (#23259) - #25531

Merged
PurHur merged 2 commits into
masterfrom
agent/stdlib-23259-abs-floor-ceil-num
Jul 30, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/stdlib-23259-abs-floor-ceil-num

Conversation

@PurHur

@PurHur PurHur commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Map abs / floor / ceil to Zend stub param num in BuiltinParamNames (php-src ext/standard/basic_functions.stub.php); InternalArgInfo still advertised number.
  • Zend-style abs(num: …) / floor(num: …) / ceil(num: …) work; legacy number: is rejected.
  • PHP-in-PHP only — no C runtime changes.

Closes #23259

Test plan

  • php bin/vm.php test/repro/issue_23259_abs_floor_ceil_named.php → ok
  • vendor/bin/phpunit --filter testAbsFloorCeilZendStubNamedParams → OK
  • vendor/bin/phpunit --filter named_args_abs_floor_ceil test/compliance/ → OK (6)
  • php bin/compile.php -o /tmp/x test/repro/issue_23259_abs_floor_ceil_named_aot.php && /tmp/x → 3\n3
  • vendor/bin/phpunit --filter abs_floor_ceil_named_params test/aot/ → OK

Not covered: floor/ceil (and float abs) under AOT already return 0 on master for positional calls — out of scope for this Reflection/named-arg fix.

Verification transcript

$ php bin/vm.php test/repro/issue_23259_abs_floor_ceil_named.php
ok
$ vendor/bin/phpunit --filter named_args_abs_floor_ceil test/compliance/
OK (6 tests, 6 assertions)
$ php bin/compile.php … issue_23259_abs_floor_ceil_named_aot.php && run
3
3
$ vendor/bin/phpunit --filter abs_floor_ceil_named_params test/aot/
OK (1 test, 5 assertions)

Made with Cursor

PurHur and others added 2 commits July 30, 2026 21:15
Map Zend stub name num in BuiltinParamNames so abs(num:), floor(num:),
and ceil(num:) match php-src instead of InternalArgInfo's number.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the AOT fixture on int abs only — floor/ceil and float abs already
miscompile under AOT on master (positional returns 0).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 61f4874 into master Jul 30, 2026
1 check failed
@PurHur
PurHur deleted the agent/stdlib-23259-abs-floor-ceil-num branch July 30, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: abs/floor/ceil Reflection names number — Zend num; named args rejected (ext/standard/basic_functions.stub.php)

1 participant