elasticsearch-php
elasticsearch-php copied to clipboard
PHP 8.2 compatibility in Elasticsearch PHP client version 7
Summary of problem or feature request
Elasticsearch PHP client claims it is compatible with PHP 8.2:
https://github.com/elastic/elasticsearch-php/blob/1890f9d7fde076b5a3ddcf579a802af05b2e781b/composer.json#L19
When installing elasticsearch/elasticsearch:^7.0 running PHP 8.2.0RC2 and making some requests, I get the following deprecation warning:
Deprecated: Creation of dynamic property GuzzleHttp\Ring\Client\CurlMultiHandler::$_mh is deprecated in /tmp/scout_elastic_test/vendor/ezimuel/ringphp/src/Client/CurlMultiHandler.php on line 47
I have submitted an upstream patch ezimuel/ringphp#7 which should fix the above, but I'm not sure if it has been noticed yet.
From my basic checks, it otherwise seems compatible.
Code snippet of problem
Our full test for ES7 compatibility is here.
$client = \Elasticsearch\ClientBuilder::create()->build();
$client->index(['index' => 'my_index', 'id' => 'my_id', 'body' => ['testField' => 'abc']]);
$client->get(['index' => 'my_index', 'id' => 'my_id']);
$client->search(['index' => 'my_index', 'body' => ['query' => ['match' => ['testField' => 'abc']]]]);
$client->delete(['index' => 'my_index', 'id' => 'my_id']);
System details
- Operating System - Linux
- PHP Version - 8.2.0RC2
- ES-PHP client version - 7.17.0
- Elasticsearch version - 8.1.2
@asgrim thanks for the PR, I'll check asap.
Please note I also made a follow-up bugfix ezimuel/ringphp#9 not sure if you saw yet :+1: