Re: Magic method visibility in PHP 5.3+

From: Date: Wed, 02 Jul 2008 07:21:28 +0000
Subject: Re: Magic method visibility in PHP 5.3+
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-38699@lists.php.net to get a copy of this message
Hello there, I don't have enough time to write more detailed example, but I still want to write my opinion. I totally agree with Stanislav, because for me magic functions should be used in last leaf of some class extend tree. They are some kind of feature when you are producing the non-framework, specific project coding stuff. Which mean they should be not encapsulated and invisible. If a developer never intends on a user calling $obj->__set(...), then it > should be allowed that the public call to that method be disallowed, but > still allow the magic functionality (b/c of the presence of that magic > function.) > Giving the "user" ability to call $obj->__set() is just some kind of speed optimization, you just miss the magic thing. Another point of view is that this __set() is still a function why you want to disable the function calls and enable the functionality? B/c of the presence of that magic function? What a drama! This is not fairy world where magic should be wonderful thing which just happens. Think of us (developers) as wizards, who know how/why this magic works! Nothing personal just some thoughts. Regards, Dimitar Isusov

« previous php.internals (#38699) next »