加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 使用未定义的常量 – 假设” – 空白常量?

发布时间:2020-12-13 17:41:31 所属栏目:PHP教程 来源:网络整理
导读:未定义的内容错误通常非常有用且易于解决,但我在开发和生产服务器(不同的设置)上得到了一些非常奇怪的行为. 我的错误日志显示了大量的错误,如下所示: NOTICE (5): [8] Use of undefined constant - assumed ' ' (#PATH#/dashboard/tasks.tpl) [61]NOTICE (5
未定义的内容错误通常非常有用且易于解决,但我在开发和生产服务器(不同的设置)上得到了一些非常奇怪的行为.

我的错误日志显示了大量的错误,如下所示:

NOTICE (5): [8] Use of undefined constant   - assumed ' ' (#PATH#/dashboard/tasks.tpl) [61]

NOTICE (5): [8] Use of undefined constant   - assumed ' ' (#PATH#/index/view.tpl) [158]

NOTICE (5): [8] Use of undefined constant   - assumed ' ' (#PATH#/blogs/index.tpl) [51]

对我来说,系统试图将“空白”定义为常量?

通常我可以通过遵循亚麻布来解决错误,其中它们总是像这样的PHP关闭标签<?php}?>并首先删除两个空格<?php}?>并再次添加它我有时可以解决问题.但是新的错误不断涌现.

我使用netbeans作为IDE.

这是完整的堆栈跟踪

#0 #PATH#/docs/application/libraries/Zend/View.php(108): include('#PATH#/d...')
#1 #PATH#/docs/application/libraries/Zend/View/Abstract.php(835): Zend_View->_run('#PATH#/d...')
#2 #PATH#/docs/application/libraries/Engine/Content/Widget/Abstract.php(292): Zend_View_Abstract->render('application/modules/Blog/widgets...')
#3 #PATH#/docs/application/libraries/Engine/Content/Widget/Abstract.php(258): Engine_Content_Widget_Abstract->renderScript()
#4 #PATH#/docs/application/libraries/Engine/Content/Element/Widget.php(66): Engine_Content_Widget_Abstract->render()
#5 #PATH#/docs/application/libraries/Engine/Content/Element/Abstract.php(583): Engine_Content_Element_Widget->_render()
#6 #PATH#/docs/application/libraries/Engine/Content/Decorator/Children.php(31): Engine_Content_Element_Abstract->render()
#7 #PATH#/docs/application/libraries/Engine/Content/Element/Abstract.php(594): Engine_Content_Decorator_Children->render('')
#8 #PATH#/docs/application/libraries/Engine/View/Helper/Content.php(78): Engine_Content_Element_Abstract->render()
#9 #PATH#/docs/application/modules/Core/views/scripts/index/index.tpl(10): Engine_View_Helper_Content->renderWidget('blog.list-recent-blogs')
#10 #PATH#/docs/application/libraries/Zend/View.php(108): include('#PATH#/d...')
#11 #PATH#/docs/application/libraries/Zend/View/Abstract.php(835): Zend_View->_run('#PATH#/d...')
#12 #PATH#/docs/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(903): Zend_View_Abstract->render('index/index.tpl')
#13 #PATH#/docs/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(924): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.tpl',)
#14 #PATH#/docs/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(963): Zend_Controller_Action_Helper_ViewRenderer->render()
#15 #PATH#/docs/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#16 #PATH#/docs/application/libraries/Zend/Controller/Action.php(523): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#17 #PATH#/docs/application/libraries/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
#18 #PATH#/docs/application/libraries/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http,Zend_Controller_Response_Http)
#19 #PATH#/docs/application/modules/Core/Bootstrap.php(75): Zend_Controller_Front->dispatch()
#20 #PATH#/docs/application/libraries/Engine/Application.php(160): Core_Bootstrap->run()
#21 #PATH#/docs/application/index.php(194): Engine_Application->run()
#22 #PATH#/docs/index.php(24): include('#PATH#/d...')
#23 {main}

对此行为的任何建议将非常感谢

感谢您的反馈.通过在netbeans中启用不可打印的字符(菜单栏中的view->不可打印的字符),我能够看到差异.

我复制了一个“坏”空间和一个大括号,并在整个项目中进行了搜索/替换,以便快速解决问题.

解决方法

这些行中有一个 non-breaking space.
您可以向NetBeans请求 display it.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读