|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55754 Only variables should be passed by reference for ZEND_SEND_PREFER_REF params
Submitted: 2011-09-21 12:46 UTC Modified: 2011-10-16 00:34 UTC
From: dk at uw dot no Assigned: stas (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
22 + 44 = ?
Subscribe to this entry?

 [2011-09-21 12:46 UTC] dk at uw dot no
Built-in functions where a parameter is defined with ZEND_SEND_PREFER_REF raises a Strict Standards warning if an expression is passed as the argument.

The PREFER part signals the preference of passing by reference, but if the argument is not a variable, it should behave as if the parameter was defined with ZEND_SEND_BY_VAL and keep quiet, just as for regular ZEND_SEND_BY_VAL parameters.

Test script:


current($arr = array(0 => "a")); /* Strict Standards: ... */ 
current(array(0 => "a"));


Actual result:
Strict Standards: Only variables should be passed by reference in filename on line 5


bug55754-test-case_v2.patch (last revision 2011-10-06 16:58 UTC by dk at uw dot no)
bug_55754_minimal.patch (last revision 2011-09-23 18:45 UTC by dk at uw dot no)
bug_55754-test-case.patch (last revision 2011-09-23 15:59 UTC by dk at uw dot no)
bug_55754-php5.4-201109231430.patch (last revision 2011-09-23 15:55 UTC by dk at uw dot no)
bug_55754-php5.3-201109231430.patch (last revision 2011-09-23 15:54 UTC by dk at uw dot no)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-16 00:34 UTC]
Automatic comment from SVN on behalf of stas
Log: Bug #55754 - Only variables should be passed by reference for ZEND_SEND_PREFER_REF params
 [2011-10-16 00:34 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2011-10-16 00:34 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 21:01:23 2020 UTC