Creating nodes Error
In Result.php line 98:
array_combine() expects parameter 1 to be array, string given
When I am creating multiple nodes, using addNode, and commit, I get the above error. I am using PHP 7.2.15, redis-graph 1.99, and redis 5.05
A sample response object that creates this error:
[0]=>
array(4) {
[0]=>
string(15) "Labels added: 1"
[1]=>
string(18) "Nodes created: 514"
[2]=>
string(20) "Properties set: 3054"
[3]=>
string(52) "Query internal execution time: 9.525500 milliseconds"
}
}
The code expects there to be arrays of depth 3, but in this instance we only have an array of depth 2!
run into this too with PHP 7.3
src\Redis\Graph\Query\Result.php line 91 if (!isset($response[1]) || !is_array($response[1])) { line 94 $this->keys = $response[0]; line 95 foreach ($response[1] as $val) { line 102 if (!isset($response[2]) || !is_array($response[2])) { line 106 foreach ($response[2] as $line) {
I think this is caused by changes in redis-graph: By reverting from 1.99, to 1.2.0, my issue was resolved!
php 7.3 works also with RedisGraph 1.2.2 (using Docker version) and this client
dirty (and untested) fix: https://github.com/rolandinsh/php-redis-graph/commit/17a51926ca2d5911e92208d2a68b6f0341e3fb77
"works on my machine"