note 114381 added to language.references.pass

From: Date: Thu, 13 Feb 2014 20:33:05 +0000
Subject: note 114381 added to language.references.pass
Groups: php.notes 
Request: Send a blank email to php-notes+get-198504@lists.php.net to get a copy of this message
Stating "Passing by reference" is a misnomer. Objects are not passed by reference. A correct statement would be Object references are passed by value. As stated at http://www.php.net/manual/en/language.oop5.references.php A simple "litmus test": swap( &$arg1, &$arg2) { $temp = $arg1; $arg1 = $arg2; $arg2 = $temp; } $var1 = ...; $var2 = ...; swap($var1,$var2); Does calling swap actually cause these to be changed? If not it isn't Pass-by-reference. Concept care of JavaDude.com -- Scott Stanchfield ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/language.references.pass.php Edit -- https://master.php.net/note/edit/114381 Del: integrated -- https://master.php.net/note/delete/114381/integrated Del: useless -- https://master.php.net/note/delete/114381/useless Del: bad code -- https://master.php.net/note/delete/114381/bad+code Del: spam -- https://master.php.net/note/delete/114381/spam Del: non-english -- https://master.php.net/note/delete/114381/non-english Del: in docs -- https://master.php.net/note/delete/114381/in+docs Del: other reasons-- https://master.php.net/note/delete/114381 Reject -- https://master.php.net/note/reject/114381 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198504) next »