#33314 [Com]: Child class variable change not propogated during function call
| From: | confins_de_l_univers at yahoo dot fr | Date: | Tue, 06 Feb 2007 03:44:27 +0000 |
| Subject: | #33314 [Com]: Child class variable change not propogated during function call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108468@lists.php.net to get a copy of this message | ||
ID: 33314
Comment by: confins_de_l_univers at yahoo dot fr
Reported By: gregory dot szorc at case dot edu
Status: No Feedback
Bug Type: Class/Object related
Operating System: Linux (multiple)
PHP Version: 5CVS-2005-06-12
New Comment:
I think it's a typo error.
In the Start() method, he use :
$this->$Dynamic = $Dynamic;
but he should use :
$this->Dynamic = $Dynamic;
so $this->Dynamic is not set when he call GetArray() method
Previous Comments:
------------------------------------------------------------------------
[2007-02-06 01:08:22] xstex2 at hotmail dot com
Any update on this issue?
------------------------------------------------------------------------
[2006-12-14 07:55:17] andrew at azarov dot com
class.php:
<?
class Test
{
var $Dynamic = Array();
function Start()
{
$Dynamic = Array("test"=>"hope")
$this->$Dynamic = $Dynamic;
}
function GetArray()
{
return $this->Dynamic;
}
}
?>
test.php:
<?
require class.php;
$file = new Test();
$file->Start();
print_r($file->Dynamic); // Will result in 'Array()'
$s = $file->GetArray(); // Will result in 'Fatal error: Cannot access
empty property'
print_r($s)
?>
------------------------------------------------------------------------
[2005-06-23 01:00:04] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-06-15 18:14:28] tony2001@php.net
Gregory, if you provide an example (even relatively big) it would be
MUCH easier for us to understand what are you talking about (and to fix
it too).
Please cook a script (okay, let it be BIG script), put it somewhere on
the Net (no SVN and other exotic things please, just a plain HTTP) and
give us the link.
Thanks in advance.
------------------------------------------------------------------------
[2005-06-15 16:11:59] gregory dot szorc at case dot edu
I have tried to recreate the problem by recreating the basic
class hierarchy that exists in my project. Unfortunately, I
have been unable to duplicate. I would gladly try and debug
things myself, but I have no knowledge regarding debugging
core PHP.
The problem occurs in BaseLayout.php. It is reproducable
through tests/iCal_create.php. The test program doesn't
even involve a lot of the classes. Considering that the
problem is an object reference being lost/ignored as it is
passed back to a function, I would think this would be a
relatively easy problem to debug. Who knows.
If someone could provide instructions for how to debug this
problem, I would attempt to do it myself.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33314
--
Edit this bug report at http://bugs.php.net/?id=33314&edit=1