Skip to content
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

Reflection calls with ...Args should support associative arrays for PHP 8 #3355

Open
Zekfad opened this issue Apr 27, 2024 · 3 comments
Open

Comments

@Zekfad
Copy link

Zekfad commented Apr 27, 2024

Description

With PHP 8 we have named arguments and support for arbitrary arguments order.
Making ReflectionClass::newInstanceArgs and ReflectionMethod::invokeArgs support associative arrays will mirror that functionality from reflection.
Use case is for skipping retrieval of optional parameters and simplifying managements of arguments array.

@nielsdos
Copy link
Member

I'm not sure I understand, this works: https://3v4l.org/Wtas7

@Zekfad
Copy link
Author

Zekfad commented Apr 27, 2024

Yes, it seems like I was hitting different user-land bug.
It would be nice to mention thank in documentation, because there's and old note on ReflectionClass::newInstanceArgs claiming otherwise.

@nielsdos
Copy link
Member

I'll be moving this issue to the docs repo then.

It would be nice to mention thank in documentation, because there's and old note on ReflectionClass::newInstanceArgs claiming otherwise.

Indeed, and it's the top note even... I'll remove it.

@nielsdos nielsdos transferred this issue from php/php-src Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants