On 10/26/2012 05:43 AM, Clint Priest wrote:
I'm opening up several new threads to get discussion going on the
remaining "being debated" categories referenced in this 1.1 -> 1.2
change spec:
https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented/change-requests
------------------------------------------------------------------------
*Extra shorthand declaration*
Allow extra short declaration of an accessor:
class TimePeriod {
public DateTime $date;
}
/* Would be equivalent to this */
class TimePeriod {
public $date {
get() { return $this->date; }
set(DateTime $value) { $this->date = $value;}
}
}
------------------------------------------------------------------------
Thoughts?
My knee-jerk response is that I'd love to be able to do public DateTime
$date; it's nicely self-documenting and gives me very simple type safety
(and therefore a clear and useful error thrown in my face, rather than a
mystery bug later). That said, I think that goes back to my mental
model question in my previous post, and I can't fully endorse this
without knowing my mental model.
--Larry Gafield
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php