php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29400 object is no being passed by reference to reference defined method
Submitted: 2004-07-26 23:49 UTC Modified: 2004-12-21 07:42 UTC
From: marcelo at beteltecnologia dot com dot br Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 4.3.8 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-07-26 23:49 UTC] marcelo at beteltecnologia dot com dot br
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-13 07:32 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2004-12-21 07:42 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC