#36051 [Opn->Asn]: Suspicous reference-argument behavour at func($m=null)

From: Date: Tue, 17 Jan 2006 14:43:30 +0000
Subject: #36051 [Opn->Asn]: Suspicous reference-argument behavour at func($m=null)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92061@lists.php.net to get a copy of this message
ID: 36051 Updated by: derick@php.net Reported By: php at koterov dot ru -Status: Open +Status: Assigned Bug Type: Scripting Engine problem Operating System: Windows XP PHP Version: 5.1.2 -Assigned To: +Assigned To: dmitry New Comment: Dmitry, this is another one similar - I really think we should address this issue to the PHP 5.1.1 situation. Previous Comments: ------------------------------------------------------------------------ [2006-01-17 15:42:04] php at koterov dot ru Description: ------------ Seems assignment-and-passing by reference becomes broken in PHP 5.1. PHP 4.x and 5.0 work as expected. See sample below. Seems PHP assigns value to $x AFTER calling function f(), but NOT before it. Or - only copy of $x passed to f(), not $x itself (as in 4.0 & 5.0). Reproduce code: --------------- <?php function f(&$m) { $m = 123; } f($x=0); var_dump($x); ?> Expected result: ---------------- int(123) Actual result: -------------- int(0) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36051&edit=1

« previous php.bugs (#92061) next »