Is there some crucial difference in writing the registry class in MVC with magic methods and writing the class with “regular” get and set methods?
For example, if I write the class with __get and __set I would access the registry objects through $registry->foo, and the other case would be $registry->getObject(‘foo’), or something like that, you understand me. I’m interested in the differences between these two, is something better or maybe depends on the particular situation or no difference?
There is no difference. It’s mostly language specific. Use of registry is same for all languages and it’s up to you how you solve read/write problem on implementation level. Only important thing is correctness of implementation everything else depends on: a) project level coding conventions; b) your taste; c) language abilities.