Re: Property Overloading RFC

From: Date: Mon, 08 Aug 2005 12:43:40 +0000
Subject: Re: Property Overloading RFC
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-17597@lists.php.net to get a copy of this message
Hi! Sorry for wrong threading or if this solution was suggested before... i currently don't have access to my mail client:) > 3. There is no way for the magic methods to return a meaningfull error > when a property doesn't "exist". Of course it is possible to throw an > error with "trigger_error" or "throw" in case a property doesn't > "exist" > in a specific class, but the file and line numbers would not match the > actually get/set action. debug_backtrace() can be used to retrieve the > correct file and line, but as you have to do this for every class where > you want to use setters and > getters *and* you have to implement your own error message rendering > function this is not really a suitable option either. Don't know if this can be implemented... but what's about a 3rd boolean "handled" call-by-reference-parameter which must be switched to "TRUE" if the property could be handled? Should be TRUE if ommitted for bc reasons, of course. greets, Roland

« previous php.internals (#17597) next »