Fatal error: Cannot redeclare 常见问题
发布:smiling 来源: PHP粉丝网 添加日期:2013-11-29 15:10:18 浏览: 评论:0
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(emptyempty($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(emptyempty($format))
- {
- $format = 'y-m-d h:i:s';
- }
- return gmdate ($format,$timest+$addtime);
- }
就会出现fatal error: cannot redeclare mydate() (previously declared in
Tags: Fatal error: Cannot
- 上一篇:在php中中文乱码解决方法
- 下一篇:设置php.ini 脚本超时方法
相关文章
- ·Fatal error: Call to undefined function curl_init(2013-11-28)
- ·php中Fatal error: Class ZipArchive not found的解决办法(2013-12-02)
- ·php错误Fatal error: Out of memory (allocated 262144)(2013-12-04)
- ·Fatal error: Out of memory (allocated 786432)提示解决办法(2013-12-04)
- ·Fatal error: Maximum execution time of 30 错误(2013-12-04)
- ·Fatal Error: Allowed memory size of 123456789 bytes exhausted(2013-12-04)
- ·PHP 报错 Fatal error: Class 'COM' not found in(2013-12-05)
- ·PHP Fatal error: Cannot use object of type stdClass as array in错误(2014-09-20)
- ·php程序执行超时解决办法(Fatal error: Maximum execution time of 30)(2014-09-21)
- ·php提示Fatal error: Call to undefined function imagecreate()(2014-09-21)
- ·Fatal error: Allowed memory size of 134217728 bytes exhauste(2014-09-21)
- ·php Fatal error: Call to undefined function imagecreatefromjpeg()(2015-04-04)
- ·php Fatal error: Call to undefined function mb_convert_encoding()(2015-04-04)
- ·php提示Fatal error: Call to undefined function openssl_x509_parse()(2015-04-04)
- ·php使用ZipArchive提示Fatal error: Class ZipArchive not found in(2015-04-09)
- ·Fatal error: Access level to xxx must be protected 错误解决(2016-08-25)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)