php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50928 Function $i param not incremented
Submitted: 2010-02-03 15:21 UTC Modified: 2010-02-03 16:33 UTC
From: mstf at mstf dot name dot tr Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.12 OS: All
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: mstf at mstf dot name dot tr
New email:
PHP Version: OS:

 

 [2010-02-03 15:21 UTC] mstf at mstf dot name dot tr
Description:
------------
Tested on v5.2.11

function $i param not incremented



Reproduce code:
---------------
<?php
function test(&$i){
	$i = $i + 5;
}

test($i = 1); // But only "$i" work
echo $i
?>

Expected result:
----------------
echo $i; // 6

Actual result:
--------------
echo $i; // 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-03 16:33 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is the error I get when running it:

Strict standards: Only variables should be passed by reference in - on line 6

Call Stack:
    4.3075     111344   1. {main}() -:0

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC