Issue: https://github.com/php/php-src/issues/10229
Author: procodix
### Description
The following code:
```php
<?php
$params = [
'param1' => 1,
'param2' => new Class {
public function __toString():string {return 'test';}
}
];
echo http_build_query($params);
foreach ($params as $k => &$v) $params[$k] = (string) $v;
echo http_build_query($params);
```
Resulted in this output:
```
param1=1
```
But I expected this output instead:
```
param1=1¶m2=test
```
... as __toString() should have been implicitly called on the object. The ugly manual conversion
shouldn't be necessary.
### PHP Version
PHP 8.1
### Operating System
Any