Re: RFC: Property get/set syntax

From: Date: Fri, 20 Apr 2012 10:35:32 +0000
Subject: Re: RFC: Property get/set syntax
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
2012/4/20 Stas Malyshev <[email protected]>:
> How these would work with isset - what !empty($this->Hours) return? What
> would happen if you do unset($this->Hours)? What happens if you do
> $this->Hours++ or sort($this->Hours) (assuming $Hours is an array)?
> These things need to be defined in the RFC too.

My suggestion is to support the same methods for properties as we do
for magic class methods: __set, __get, __isset and __unset.
All the other operations (sort, ++, <<,...)  should behave exactly as
if it was be implemented with current magic class methods with a usual
switch/case statement.


Thread (12 messages)

« previous php.internals (#60229) next »