Re: [VOTE] Property Accessors for 5.5

From: Date: Sun, 20 Jan 2013 23:28:56 +0000
Subject: Re: [VOTE] Property Accessors for 5.5
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-65048@lists.php.net to get a copy of this message
Hello Clint, Nikita and Stas.
To facilitate complete functionality with properties it is necessary to provide accessor functions to act on isset() and unset() calls. Note: isset & unset implementations are always provided with default implementations unless the author explicitly defines their own.
a) With magic methods we can make the accessed property inaccessible (as properties may appear/disappear at runtime) and so we need some magic there (__isset/__unset as of 5.1). A property (accessors) is defined at design-time and may not become inaccessible so the default implementation for isset/unset should be sufficient. b) Result of (unset)$this->foo is always NULL. If we provide a way to alter this "set(NULL)" behavior: - it may fail before calling set(NULL) - unset($this->foo); $this->foo !== (unset)$this->foo; // foo is not foo? c) Logically isset/unset methods wrap up getter/setter at a higher level. Maybe both methods are better suited for "operator overloading/overriding RFC" where i would again expect some magic too. I wonder what the functionality would be as someone have to override isset/unset accessors. Do you have some examples? cryptocompress http://3v4l.org/NJWsW

« previous php.internals (#65048) next »