2

I'm using PhpDocumentor (1.4.4) & NetBeans (7.1). When I generate the php documentation I get an error/warning on the top of the documentation (and in documentation in certain places too):

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

Does anybody know why is this problem? Formerly (not on this computer) I didn't get this message.

  • possible duplicate of [Strict Standards: Only variables should be passed by reference](http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference) – Lorenz Meyer Jun 21 '14 at 08:37

3 Answers3

1

The root cause here is that phpDocumentor itself if PHP4 code. I'm guessing you are executing it on PHP5, and are thus seeing runtime notices based on your error reporting level in php.ini.

This is nothing to worry about with regard to using phpDocumentor, nor is it something to worry about in your source code that you are documenting.

ashnazg
  • 6,558
  • 2
  • 32
  • 39
  • I am using php 5.4.16. I can see the document, but it is very annoying since the error appears within the document. Are you sure this is caused because of php >5 ? – themhz May 21 '15 at 07:37
  • But are you also using that old phpDocumentor 1.4.4 version mentioned in the OP? Or are you using a newer 2.x version? If the latter, then my answer won't apply. – ashnazg May 21 '15 at 18:02
  • I am using php documentor, 1.4.4. I see it in the generated documentation. , "This documentation was generated by phpDocumentor v1.4.4" But my php version is 5.4.16 – themhz May 22 '15 at 20:23
  • 1
    Ah, a thought -- are you viewing your docs through a browser where the files are being served by a webserver? If so, then I wonder if it's some of the *old* template code being executed by the webserver when you hit the page, and that's where the visible errors are coming from (runtime errors rather than error text included in the doc itself). You might try an .htaccess file in the root doc dir, set error reporting to 0 there, and see if that clears it. If so, that's the culprit. If not, then I'm still lost :) – ashnazg May 26 '15 at 16:02
  • Thank you for your reply. Well I actually edited the html files that were generated and the errors were on the document. I guess the problem was because of the version of php that the php documentor was using. So I changed phpdocumentor to 2.2 and now it works without displaying errors. I am using php 5.4.16 so there should be alot of depricated commands in the old version – themhz May 27 '15 at 04:02
0

PHP Documentation states:

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.

This has been the case since PHP 4.0.4. Most likely your source code is out-dated and needs changes.

sikander
  • 2,286
  • 16
  • 23
  • It's not my code: "Strict Standards: Only variables should be passed by reference in C:\xampp\PhpDocumentor-1.4.4\PhpDocumentor-1.4.4\phpDocumentor\Smarty-2.6.0\libs\Smarty_Compiler.class.php on line 712" - this is the full message – David Soljezin Mar 15 '12 at 19:45
  • Well, you can edit line 712 in Smarty_Compiler.class.php so it doesn't pass by reference or you can upgrade Smarty to the latest available version (3.1.8) http://www.smarty.net/ – sikander Mar 15 '12 at 19:52
  • With the new version I get smarty exceptions so forget it. In Smarty_Compiler.class.php How could I edit that line to work ? – David Soljezin Mar 15 '12 at 20:12
  • I guess The problem is the _compile_arg_list function's return value (it's an array)... – David Soljezin Mar 15 '12 at 20:28
0

At last the solution:

I used smarty themes (HTML:Smarty:*) and there was no errors.

Solved.

  • I am getting this error to. Can you please be more specific? I am using smarty themes to in netbeans 8.0.2 – themhz May 21 '15 at 07:31