Issue 73: magic get/set methods
Status:  New
Owner: ----
Reported by m...@mail.ru, Sep 18, 2013
Hi,

could you please replace these with just getters/setters or declare appropriate fields as protected?

The presence of magic get/set hides the real presence/absence of fields, thus accessing any not existent field from a derived class does not produce any errors. 

This increase debugging time significantly, while having regular getters/setters would be able to detect such issues during a few seconds

Thanks


Sep 18, 2013
#1 m...@mail.ru
same here, ready to prepare a patch
Sep 19, 2013
Project Member #2 mewp...@gmail.com
In my opinion, getter and setter functions would decrease readability without offering any real benefit. I can't really think of any situation where someone would spend significantly more time because he's misspelled a variable name.

If and when php will implement proper getter/setter syntax (not defining getVariable/setVariable functions) functions, I will use them.

Your concern about hiding the real presence of fields is somewhat valid though, but can be solved by implementing __isset. And that's what I'll do (or you can submit a patch/pull request, if you want to).
Sep 19, 2013
#3 m...@mail.ru
at least could you please throw an exception on access to not existent fields? It is really easy fix, just to add one more  'else'

thanks