On 20.02.2008, at 09:28, Stefan Marr wrote:
Hi Lars,
What about abstract methods in traits? I think this could be handy to
enforce the user class implement a data getter.
trait Foo {
public function doSomething()
{
return str_replace("foo", "bar", $this->_getString());
}
abstract protected _getString();
}
class Consumer
{
use Foo;
protected function _getString()
{
return "foo";
}
}
What do you think?
I am sorry :) This part has been missing in the RFC.
But is already implemented in the patch and supposed to work exactly
like you has described it.
Maybe its best to first leave out interfaces/abstract etc. Start
simple, see how things get used, get more comfortable with the feature
and then see about potentially expanding it.
regards,
Lukas
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php