Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability

From: Date: Sun, 28 Oct 2012 07:15:43 +0000
Subject: Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-63686@lists.php.net to get a copy of this message
Am 28.10.2012 02:42 schrieb "Clint Priest" <cpriest@zerocue.com>: > > Sounds like you're implying that the mere existence of a properly named function such as __prop_get_hours() would cause it to be called instead of returning the property. Only when the property does not exist, just like it is with __get > 1) Currently __get() is only checked/invoked if there is not a property already defined; ie properties shadow __get() (no performance penalty) Right. I would expect / hope for __prop_get_XXX to work exactly the same. > 2) It would dramatically reduce performance because every property access would have to create the function string, get it's hash value and ..... But that only applies to an "accessor shadows property" doctrine, and that is one of these complications / complexity issues which makes me prefer the "property exists means it's definite" doctrine as already deployed with __get. best regards Patrick

« previous php.internals (#63686) next »