php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dk at uw dot no
New email:
PHP Version: OS:

 

 [2011-09-21 12:46 UTC] dk at uw dot no
Description:
------------
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:
---------------
<?php

error_reporting(32767);

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

?>

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

Patches

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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-16 00:34 UTC] stas@php.net
Automatic comment from SVN on behalf of stas
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=318137
Log: Bug #55754 - Only variables should be passed by reference for ZEND_SEND_PREFER_REF params
 [2011-10-16 00:34 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2011-10-16 00:34 UTC] stas@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 22:01:25 2019 UTC