Have you tried passing by reference ? call_user_method('increase', &$foo);
- Markus On Sun, Oct 21, 2001 at 11:12:00PM -0000, [EMAIL PROTECTED] wrote : > [2001-02-03 17:21:00] [EMAIL PROTECTED] > > First some sample code: > > > class foo { > var $bar = 0; > function increase () { > $this->bar++; > } > } > > $foo = new foo; > > print "Bar: " . $foo->bar . "\n"; > call_user_method('increase', $foo); > print "Bar: " . $foo->bar . "\n"; > > $foo->increase(); > print "Bar: " . $foo->bar . "\n"; > > > This will output: > > Bar: 0 > Bar: 0 > Bar: 1 > > It appears that call_user_method is working on a copy of the object rather than the >object itself. > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]