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
 [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

Pull Requests

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: Sat Dec 21 17:01:58 2024 UTC