Hacker News new | ask | show | jobs
by Joeri 4642 days ago
You can easily add something like accessors using traits. I cooked this up in 5 minutes: https://gist.github.com/jsebrech/6740010

You can do a lot with meta-programming in PHP. For example, you can write your own array type if you are so inclined and use it anywhere you would use an array. Here's an experimental library that showcases the meta-programming abilities: https://github.com/jsebrech/php-o

1 comments

i can do something interesting with __set and __get , but i really just want it to be part of the language. Nice ideas in the meantime tho.