Hacker News new | ask | show | jobs
by maerF0x0 4648 days ago
I like the look of this "hack". It adds things to PHP that I missed from C# .. now if they will add Accessors syntax, that would be nice, especially for those that use Doctrine2. PHP is as professional of a language as the user. I found fun working with PHP, C#, (node)js, python and think each has its own way, quirks and benefits.
1 comments

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

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.