On Wed, April 26, 2006 6:46 pm, David Otton wrote:
> class Test {
> var $x;
> function Test ()
> {
> global $addition, $subtraction;
> $this->x = 0;
> $addition = array ($this, 'AddOne');
> $subtraction = array ($this, 'Sub
The problem is not what it seems. PHP4 assigns object by copy, not by
reference. This is causing the call_user_func() to use a copy of the object
instead of the original object. So, all modifications are lost once the call
is done. One solution to this is to assign objects by reference:
$addition
2 matches
Mail list logo