【fatal error】Fatal error: Cannot redeclare 常见问题

时间:2017-01-23  来源:常见问题  阅读:

fatal error: cannot redeclare这种问题php教程 开发可能会碰到过,原因是很简单的,就是重复调用了相同名字的函数,

function mydate($format="y-m-d h:i:s",$timest=0)
{
 global $cfg_cli_time;
 $addtime = $cfg_cli_time * 3600;
 if(empty($format))
 {
  $format = "y-m-d h:i:s";
 }
 return gmdate ($format,$timest+$addtime);
}

面我的

require_once(dedeinc."/inc/inc_fun_funstring.php");


也包含了一个名为mydate的函数如果现在我们这样用就出现如

a.php

require_once(dedeinc."/inc/inc_fun_funstring.php");
function mydate($format="y-m-d h:i:s",$timest=0)
{
 global $cfg_cli_time;
 $addtime = $cfg_cli_time * 3600;
 if(empty($format))
 {
  $format = "y-m-d h:i:s";
 }
 return gmdate ($format,$timest+$addtime);
}

就会出现fatal error: cannot redeclare mydate() (previously declared in

【fatal error】Fatal error: Cannot redeclare 常见问题

http://m.bbyears.com/jiaocheng/29957.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新