|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-13 07:32 UTC] sniper@php.net
[2004-12-21 07:42 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Description: ------------ I have a method that receives a object by reference. Despite the method definition defines that the parameter should be taken by reference it is being treated as it were a copy. Reproduce code: --------------- class Myclass extends MyOtherClass { function mymethod(&$myobj) { $myobj->mymodifier('Parameter'); } } Expected result: ---------------- the 'mymodifier' method of the original 'myobj' object should be called. Actual result: -------------- PHP is calling the method 'mymofifier' for a copy of the instance of 'myobj'. I used Call-time pass-by reference, to avoid the problem but, since this technique is deprecated I am reporting the bug.