Re: RFC: C-sharp style property get/set syntax for PHP
| From: | larry@garfieldtech.com | Date: | Mon, 29 Nov 2010 19:40:05 +0000 |
| Subject: | Re: RFC: C-sharp style property get/set syntax for PHP | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50705@lists.php.net to get a copy of this message | ||
On 11/29/10 12:41 PM, Johannes Schlüter wrote:
On Mon, 2010-11-29 at 12:18 -0600, larry@garfieldtech.com wrote:I was referring to the compiler I guess. I don't do C so I have no idea what it's capable of. If that's not a possible performance optimization point, then blargh. I still want to keep the performance implications in mind, as this sounds like something that we'd want to use a lot but could also cost a lot more than it seems at first glance if we're not careful. --Larry GarfieldAnother advantage here would presumably be performance. If there's no getter defined then the engine could simply map $foo->bar to the class member directly (which is really fast) and not to a method, so there's no added overhead there. That still leaves the question of what happens with name collisions, though.Don't kow what you mean by "the engine" in this case? The compiler? - no the compiler can't a) it has no idea what type $foo is b) think about inheritance etc. The executor - well there's no win possible. johannes