有人可以告訴我爲什麼我得到 未定義的方法print_hash()錯誤?OOP PHP奇怪的undefined方法
我有下面的類
class EmailManager{
private $replytoArray;
private $receiverArray;
private $fromArray;
function __construct(){
$replytoArray = array();
$receiverArray = array();
$fromArray = array();
}
function addReceiver($k){
if(!in_array($k, $receiverArray)){
$receiverArray[] = $k;
return true;
}
return false;
}
function addReplyTo($k){
if(!in_array($k, $replytoArray)){
$replytoArray[] = $k;
return true;
}
return false;
}
function debug(){
print_hash($replytoArray);
print_hash($receiverArray);
}
function print_hash($k){
echo "<pre>";
print_r($k);
echo "</pre></br>";
}
}
我想確保一切都很好,所以我想測試一下
<?php
error_reporting(E_ALL);
ini_set("display_errors",1);
require_once("EmailManager.php");
$em = new EmailManager();
$em->debug();
//$em->addReceiver("[email protected]");
?>
謝謝! noobster在這裏。 – denniss 2010-07-21 08:36:02
沒有問題,我可以忽略類似的東西:) – fabrik 2010-07-21 08:37:16