|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53356 Allow use function return value in write context
Submitted: 2010-11-19 15:50 UTC Modified: 2015-04-06 09:30 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: lifinsky at yandex dot ru Assigned:
Status: Re-Opened Package: Scripting Engine problem
PHP Version: 5.3.3 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lifinsky at yandex dot ru
New email:
PHP Version: OS:


 [2010-11-19 15:50 UTC] lifinsky at yandex dot ru
Allow use function return value in write context if this function return value by reference (Such as c or c++)

Test script:
function &test() {
	static $a = 0;
	return $a;


Expected result:

Actual result:
Fatal error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-27 14:24 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: tyrael
 [2015-03-27 14:24 UTC]
The fix for this bug has been committed.

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.

this will be supported in php7 as you can see here:
 [2015-03-27 14:30 UTC]
-Status: Closed +Status: Re-Opened
 [2015-03-27 14:30 UTC]
That change was not intentional and we may want to revert it. Especially given how it currently allows you to write this even if the function does not return by reference.
 [2015-04-06 09:30 UTC]
-Assigned To: tyrael +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 08:01:31 2024 UTC