You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While waiting on a reply on #1084, I'm stuck in a situation where I do have PHP 8.0 on my machine already, but cannot update my project because I cannot do a composer install on PHP 8.0. I can however run my already locally installed code in PHP 8.0, so there I got this bug.
Summary of problem or feature request
I got the following Exception when running stuff with Elastic in PHP 8.0:
ErrorException
Elasticsearch\Connections\Connection::Elasticsearch\Connections\{closure}(): Argument #2 ($key) must be passed by reference, value given
at vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:357
353▕ $value = 'true';
354▕ } elseif ($value === false) {
355▕ $value = 'false';
356▕ }
➜ 357▕ }
358▕ );
359▕
360▕ $uri .= '?' . http_build_query($params);
361▕ }
Code snippet of problem
The full method where this happens is here (comment mine):
Only the values of the array may potentially be changed; its structure cannot be altered, i.e., the programmer cannot add, unset or reorder elements. If the callback does not respect this requirement, the behavior of this function is undefined, and unpredictable.
... so I think that's why in PHP 8.0 this got stricter?
System details
Operating System: macOS 10.15.7
PHP Version: v8.0.0
ES-PHP client version: v7.9.1
Elasticsearch version: v7.6.1
The text was updated successfully, but these errors were encountered:
While waiting on a reply on #1084, I'm stuck in a situation where I do have PHP 8.0 on my machine already, but cannot update my project because I cannot do a
composer install
on PHP 8.0. I can however run my already locally installed code in PHP 8.0, so there I got this bug.Summary of problem or feature request
I got the following Exception when running stuff with Elastic in PHP 8.0:
Code snippet of problem
The full method where this happens is here (comment mine):
The solution is as simple as just removing the
&
before$key
on line 346, or removing&$key
all together (it's unused).Note that the documentation on https://www.php.net/array_walk says:
... so I think that's why in PHP 8.0 this got stricter?
System details
The text was updated successfully, but these errors were encountered: