[meta] Replace usage of func_get_args with variadic functions

Created on 22 April 2023, over 1 year ago
Updated 24 August 2023, over 1 year ago

Problem/Motivation

https://www.php.net/manual/en/functions.arguments.php#functions.variable...

It is also possible to achieve variable-length arguments by using func_num_args(), func_get_arg(), and func_get_args() functions. This technique is not recommended as it was used prior to the introduction of the ... token.

From #3236391-15: [11.x] Replace func_get_args with variable-length argument in FormBuilder :

There are lots of places in core that might need a similar change. To see a full list of potential places, do:

grep -rl "func_get_args" * | grep -v "vendor"

I considered whether this should be done all in one mega cleanup, or as part of a meta (plan) issue. Since it is a BC break, we should do a meta issue.

This is also too disruptive as-is for a minor branch, which is why @catch was considering this to be a D10-only change in #7. Demonstration of the BC break:
https://3v4l.org/rEU6t

However, we can deprecate the old func_get_args() pattern in 10.1.x, and convert to ...$args in the main method signature in D11. Here's how... EDIT. Previous link was some "True value is true". Here's the real snippet:
https://3v4l.org/FNdOm

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Base 

Last updated about 11 hours ago

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024