Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种好方法可以将任意数量的命名参数传递给 php 中的函数(类似于**kwargspython 中的函数)。 func_get_args()在 php 中似乎没有这样做,因为它只是以指定的顺序产生参数,这是我试图用一些遗留 php 代码摆脱的。是否值得研究ReflectionFunction?ReflectionParameter我想过只是传递一个数组或对象作为唯一的参数,然后检查它们,但认为必须有更好的方法。
**kwargs
func_get_args()
ReflectionFunction
ReflectionParameter