I wrote this in a fever of creation, take a look:
On the second look – it’s already done for instance in CakePHP (Models behaviors, Controllers component). The only new thing here is the use of traits.
At first I thougt rails is better than PHP only because of environment (bundler, dev server, migrations, testing, gems). But for that it’s easy to catch up (say coposer for a good start). What I really miss is more dynamic nature of php itself.
So I guess I was chasing that shadow ;) Anyway – maybe someone could use this example for whatever reason. Traits gives you static Aspects (or horizontal inheritance if you prefer), this piece of code is an example of how this could be achieved dynamically.