Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不推荐:在第261行的phpExcelReader\Excel\reader.php中,不推荐通过引用分配new的返回值_Php_Warnings_Deprecated - Fatal编程技术网

不推荐:在第261行的phpExcelReader\Excel\reader.php中,不推荐通过引用分配new的返回值

不推荐:在第261行的phpExcelReader\Excel\reader.php中,不推荐通过引用分配new的返回值,php,warnings,deprecated,Php,Warnings,Deprecated,任何人有任何想法,为什么会说: Deprecated:在第261行的phpExcelReader\Excel\reader.php中,通过引用分配new的返回值是不推荐的 $this->_ole=&new OLERead() 我使用的是WAMP-PHP版本5.3.13从PHP5.3.0开始,当您在foo(&$a)中使用时,您将收到一条警告,指出“通过引用传递调用时间”是不推荐的 可能是一些旧的php语法或方法,我更改了代码,它对我有效: 早些时候: $this->_ole=&new OLERea

任何人有任何想法,为什么会说:

Deprecated:在第261行的phpExcelReader\Excel\reader.php中,通过引用分配new的返回值是不推荐的

$this->_ole=&new OLERead()


我使用的是
WAMP-PHP版本5.3.13

从PHP5.3.0开始,当您在foo(&$a)中使用时,您将收到一条警告,指出“通过引用传递调用时间”是不推荐的


可能是一些旧的php语法或方法,我更改了代码,它对我有效:

早些时候:

$this->_ole=&new OLERead()

更改为:(已删除&带符号)

$this->\u ole=new OLERead()

警告和通知现在不见了

根据这里的建议

问题出在 $this->_ole=&new OLERead(); 很抱歉很明显,但它可以通过以下方式修复,例如 $t=新的OLERead(); $this->_ole=&$t

我更改了
$this->\u ole=new OLERead()

    $t = new OLERead();
    $this->_ole =& $t;

未导入错误消息和数据。所以一切都好。但不确定这种改变是否会导致其他一些问题。如果有人知道,请给出建议。

试试这个。这非常有效。

excel_reader2.php:

关闭://函数OLERead(){}

和变化:

/**
* Constructor
*
* Some basic initialisation
function Spreadsheet_Excel_Reader($file='',$store_extended_info=true,$outputEncoding='') {
    $this->_ole = new OLERead();
    $this->setUTFEncoder('iconv');
    if ($outputEncoding != '') { 
        $this->setOutputEncoding($outputEncoding);
    }
    for ($i=1; $i<245; $i++) {
        $name = strtolower(( (($i-1)/26>=1)?chr(($i-1)/26+64):'') . chr(($i-1)%26+65));
        $this->colnames[$name] = $i;
        $this->colindexes[$i] = $name;
    }
    $this->store_extended_info = $store_extended_info;
    if ($file!="") {
        $this->read($file);
    }
} */
/**
*建造师
*
*一些基本的初始化
函数电子表格\u Excel\u阅读器($file='',$store\u extended\u info=true,$outputEncoding=''){
$this->_ole=new OLERead();
$this->setUTFEncoder('iconv');
如果($outpuntencoding!=''){
$this->setoutpunecoding($outpunecoding);
}
对于($i=1;$i=1)?chr($i-1)/26+64:“”)。chr($i-1)%26+65));
$this->colnames[$name]=$i;
$this->colindexes[$i]=$name;
}
$this->store\u extended\u info=$store\u extended\u info;
如果($file!=“”){
$this->read($file);
}
} */
是。在这里检查太多可能的副本