Re: [PHP-DEV] [RFC] Deprecations for PHP 8.6

[email protected] ("Gina P. Banyard") Mon, 13 Jul 2026 15:54:03 +0000
Newsgroups php.internals
Message-ID <hEfngBuRnxnd2tyKqbbLV9s4_TwXU7eCK_nje-HR1lxYwUFZRvZ5Cl6UBz3b6KVCFiLJA6zZVf-l0lcDSilS1bFxgVasoqOpAEx58T8bzhU=@gpb.moe>
On Saturday, 11 July 2026 at 21:19, Claude Pache <[email protected]> wrote:

> ## Passing objects for $data parameter of http_build_query()
>
> As I understand, what is proposed to be deprecated, is not only passing an object to `http_build_query` (such as `http_build_query((object)['a' => 'b'])`), but also passing an array who has an object as value (possibly at some deep level) (such as `http_build_query(['x' => (object) ['y' => 'z']])`). The deprecation message isn’t clear about that situation, because in the second case, an array is passed for argument #1 to http_build_query().

I can't comment on other people's proposal, but I tried clarifying this one as it's one of my own.
Indeed any object encountered during the traversal will emit a deprecation, I added a possible message to it.
I've also provided a function that allows recursively traversing arrays/objects to apply get_object_vars() and produce a "clean" array that can be passed to http_build_query.
Hope this addresses the remark.

Best regards,

Gina P. Banyard