Re: [PHP-DEV] Weird behaviour of private attribute + overloaded method

2004-06-15 Thread Eric Daspet
Antony Dovgal wrote: It outputs 'bool(false)', while I expect it to print 'int(123)'. Foo::id is private so Bar::setId() cannot use it. It uses an implicit public Bar::id (different from Foo::id). Foo::getId() correctly read the private attribute Foo::id (not the public Bar::id) and return it.

[PHP-DEV] Weird behaviour of private attribute + overloaded method

2004-06-15 Thread Antony Dovgal
Hi all! What do you expect from this code? id; } public function setId ($id) { return $this->id = $id; } } class Bar extends Foo { public function setId ($id) { return $this->id = $id; } } $b = new Bar; $b