php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49343 Deprecated: Call-time pass-by-reference for non-object?
Submitted: 2009-08-24 06:17 UTC Modified: 2009-08-24 08:58 UTC
From: hack988 at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 6SVN-2009-08-24 (snap) OS: Windows 2003 SP2
Private report: No CVE-ID: None
 [2009-08-24 06:17 UTC] hack988 at gmail dot com
Description:
------------
Call-time pass-by-reference for non-object Variables is Deprecated?
We can use word "new" with Call-time pass-by-value for object,but how to use  pass-by-reference in Call-time for non-object Variables like int,string,array?

Reproduce code:
---------------
$a=1;
$b=$a;
$c=&$a;
$a='cc';
tt($c);
echo $b."<BR/>";
echo $c."<BR/>";

echo "pass by value"."<BR/>";
tt(&$c);
echo $b."<BR/>";
echo $c;
function tt($aa){
	$aa="erety";
}

Expected result:
----------------
Deprecated: Call-time pass-by-reference has been deprecated in F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11
1
cc
pass by value
1
eretyPHP Deprecated: Call-time pass-by-reference has been deprecated in F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11 

Actual result:
--------------
how can i used Call-time pass-by-value for non-object Variables ?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-24 08:58 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

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 10 06:01:34 2025 UTC