Re: RFC: C-sharp style property get/set syntax for PHP
| From: | president at basnetworks dot net | Date: | Wed, 01 Dec 2010 13:26:37 +0000 |
| Subject: | Re: RFC: C-sharp style property get/set syntax for PHP | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50777@lists.php.net to get a copy of this message | ||
>> Just to chime in on the subject of performance, here is how C# handles
>> properties:
>
> PHP is not a compiled language and as such handling of properties, in
> particular, is radically different in PHP. For example, the property
> name in expression like $foo->$bar is known only in runtime.
Yes, of course. Like I say, that is just how it works in C#, I make no
claims about how it would or should work in PHP. I was just hoping that
comparisons to C# would help to inform the discussion.
However, I would imagine that the get/set within a property would be
interpreted as methods in PHP irregardless, so apart from checking to see
if a class member is a property, and finding its get/set method to call,
would the performance not be exactly that of a method call?
- Dennis