php 类的构造方法传递数组,取出来是NULL。为什么???<?php
class Excel{
var $re;
function __construct($re){
$this->exc=$re;
}
function get(){
return $this->re;
}}
?>============
<?php
require_once("./b.php");
$tem=array(1,4,7,8);$t = new Excel($tem);$ff=$t->get();var_dump($ff);======================NULL
?>
class Excel{
var $re;
function __construct($re){
$this->exc=$re;
}
function get(){
return $this->re;
}}
?>============
<?php
require_once("./b.php");
$tem=array(1,4,7,8);$t = new Excel($tem);$ff=$t->get();var_dump($ff);======================NULL
?>
$this->exc=$re;
改成
$this->re=$re;
它俩统一一下
LZ大意了