Php 错误通知:尝试在zend framework中获取非对象的属性

Php 错误通知:尝试在zend framework中获取非对象的属性,php,zend-framework,Php,Zend Framework,我使用字符集utf 8时出错: Notice: Trying to get property of non-object in C:\wamp\www\zend-search-lucene\indexing.php on line 27 这是php代码: <?php require_once 'Zend/Search/Lucene.php'; $arr_data = array(0 => array( "products" => "Google sugges

我使用字符集utf 8时出错:

Notice: Trying to get property of non-object in C:\wamp\www\zend-search-lucene\indexing.php on line 27
这是php代码:

<?php
require_once 'Zend/Search/Lucene.php';
$arr_data = array(0 => array(    "products"       => "Google suggest : pick right search keyword"),
                      1 => array("products"       => "zend framework tutorial | part 9 Zend Auth"));

$lucene_index_path = 'data/';
$index = new Zend_Search_Lucene($lucene_index_path, true);
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());

foreach($arr_data as $test) {
    //create an cache index doc
    $doc = new Zend_Search_Lucene_Document();
    $doc->addField(Zend_Search_Lucene_Field::Text('products', $test->products, 'UTF-8')); **//LINE 27**
    $index->addDocument($doc);
}
$index->commit();
$index->optimize();
$test->products
更改为
$test['products']

$test->products
更改为
$test['products']

$doc->addField(Zend_Search_Lucene_Field::Text('products', $test['products'], 'UTF-8'));