Re: [RFC] Alternative typehinting syntax for accessors

From: Date: Fri, 04 Jan 2013 22:29:53 +0000
Subject: Re: [RFC] Alternative typehinting syntax for accessors
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-64533@lists.php.net to get a copy of this message
Hi! > This shouldn't be an issue because it is not possible to set the > property without going through the setter, which would be a type hinted > accessor function. It is possible, if this property's guard is set. Since guard works for all code called from inside the setter, if setter is doing something not trivial (meaning, calls any functions, explicitly or implicitly) it is possible to set the property directly. Since the value you are getting is defined by the getter, there are no guarantees there too. So effectively, unless both getter and setter are implicit, this does not give you anything compared to the typed setter. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#64533) next »