PHP 5.1.6 出现以下错误:
Fatal error: Declaration of Tl1Telnet::ExecuteCommand() must be compatible with that of telnet::ExecuteCommand()
ExecuteCommand 在接口中正确定义实现。
interface telnet {
public function DoTelnet();
public function ExecuteCommand($command,$fh);
}
class Tl1Telnet implements telnet{
public function ExecuteCommand($command,$fh = NULL){
fputs($this->socketResource,$command);
sleep(2);
$tl1_string = fread($this->socketResource,30000);
if($fh != NULL){
fwrite( $fh, $tl1_string );
}
return $tl1_string;
}
}