2012-03-15 79 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

相關問題