2012-03-15 78 views
2

我正在使用PhpDocumentor(1.4.4)& NetBeans(7.1)。当我生成PHP文档我得到一个错误/在文件的顶部警告(以及在某些地方也文件):PhpDocumentor奇怪的错误:“只有变量应通过引用传递...”

"Strict Standards: Only variables should be passed by reference in ..." 

有谁知道为什么这个问题呢?以前(不在这台电脑上)我没有收到这条消息。

+0

[严格标准:只有变量应通过引用传递]的可能重复(http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference) – 2014-06-21 08:37:55

回答

0

最后的解决方案:

我使用Smarty的主题(HTML:Smarty的:*),并没有错误。

已解决。

+0

我得到这个错误。你可以请更具体吗?我在netbeans中使用smarty主题8.0.2 – themis 2015-05-21 07:31:24

0

PHP Documentation状态:

The following things can be passed by reference: 

- Variables, i.e. foo($a) 
- New statements, i.e. foo(new foobar()) 
- References returned from functions 

No other expressions should be passed by reference, as the result is undefined. 

这已自PHP 4.0.4的情况。很可能您的源代码已过时并需要更改。

+0

这不是我的代码:“严格的标准:只有变量应该通过引用在C:\ xampp \ PhpDocumentor-1.4.4 \ PhpDocumentor-1.4.4 \ phpDocumentor \ Smarty-2.6.0 \ libs \ Smarty_Compiler.class.php中传递第712行“ - 这是完整的消息 – 2012-03-15 19:45:22

+0

那么,你可以编辑Smarty_Compiler.class.php中的第712行,以便它不通过引用传递,或者你可以将Smarty升级到最新的可用版本(3.1.8)http:// www.smarty.net/ – sikander 2012-03-15 19:52:08

+0

随着新版本我得到聪明的例外,所以忘了它。 在Smarty_Compiler.class.php我如何编辑该行工作? – 2012-03-15 20:12:18

1

这里的根本原因是phpDocumentor本身如果是PHP4代码。我猜你正在PHP5上执行它,并因此在php.ini中查看基于错误报告级别的运行时通知。

关于使用phpDocumentor,这是没有什么可担心的,也不需要担心在源代码中记录您的文档。

+0

我使用的是php 5.4.16。我可以看到文档,但是由于错误出现在文档中,所以非常烦人。你确定这是由于php> 5引起的吗? – themis 2015-05-21 07:37:14

+0

但你是否也使用OP中提到的旧phpDocumentor 1.4.4版本?或者你使用的是更新的2.x版本?如果后者,那么我的答案将不适用。 – ashnazg 2015-05-21 18:02:09

+0

我正在使用php documentor,1.4.4。我在生成的文档中看到它。 ,“这个文档是由phpDocumentor v1.4.4生成的”但我的PHP版本是5.4.16 – themis 2015-05-22 20:23:48

相关问题