使用solr php响应时出现评估阶段错误

使用solr php响应时出现评估阶段错误,php,solr,Php,Solr,我们使用Solr PHP response获得Solr搜索结果,如下所示: $php_code = $this->file_get_contents($solr_url); eval("\$ret_array = " . $php_code . ";"); PHP Parse error: syntax error, unexpected '<' in .... 它在大多数情况下工作正常,但偶尔会出现如下php短语错误: $php_code = $this->file_

我们使用Solr PHP response获得Solr搜索结果,如下所示:

$php_code = $this->file_get_contents($solr_url);
eval("\$ret_array = " . $php_code . ";");
PHP Parse error:  syntax error, unexpected '<' in .... 
它在大多数情况下工作正常,但偶尔会出现如下php短语错误:

$php_code = $this->file_get_contents($solr_url);
eval("\$ret_array = " . $php_code . ";");
PHP Parse error:  syntax error, unexpected '<' in .... 

PHP解析错误:语法错误,意外的“var\u dump($PHP\u code)的输出是什么”?不知道。它只是偶尔发生,所以除非有办法捕获eval错误,否则很难转储它。为什么不使用solarium或solr的任何其他php客户端?