Elektrine lite

← Feed

@ghostwriter@phpc.social

2026-09-06 18:54 UTC

a little hack… because func_get_arg(), func_num_args(), and func_get_args() ignore "unknown" named variadic arguments. https://3v4l.org/e1UK7#veol edit: extract to a global function https://3v4l.org/UvZt8#veol #PHP

Replies (1)

  • @ghostwriter@phpc.social 2026-09-06 22:10

    It did not work as i expected… because we cant tell if the user passed in all of the arguments or if #PHP passed in additional default/optional arguments. But I was able to achieve my goal and got the tests passing using good ol' `debug_backtrace(~DEBUG_BACKTRACE_PROVIDE_OBJECT)`. https://3v4l.org/28O7r#veol ~DEBUG_BACKTRACE_PROVIDE_OBJECT (0): Omits index "object" and populates index "args"

    Open ##4638659