About 44,300 results
Open links in new tab
  1. Best practice: PHP Magic Methods __set and __get [duplicate]

    Possible Duplicate: Are Magic Methods Best practice in PHP? These are simple examples, but imagine you have more properties than two in your class. What would be best practice? a) …

  2. PHP __get and __set magic methods - Stack Overflow

    Jan 17, 2011 · Also, the Visual Studio extension for PHP does support intellisense with protected properties, with that trick in mind, I'd think. I would think with enough developers using the …

  3. Use of PHP Magic Methods __sleep and __wakeup - Stack Overflow

    Jul 24, 2012 · Use of PHP Magic Methods __sleep and __wakeup Asked 13 years, 4 months ago Modified 3 years, 2 months ago Viewed 38k times

  4. oop - Understanding magic methods in PHP - Stack Overflow

    Oct 19, 2013 · In conclusion, one of the main advantages of using these magic methods is if you want to access private variables of a class (which is against a lot of coding practices) but it …

  5. Are Magic Methods Best practice in PHP? - Stack Overflow

    Are Magic Methods Best practice in PHP?cons Text searches don't find the functions System is harder to understand, especially for newcomers Refactoring tools might fail more often …

  6. oop - PHP 5.3 Magic Method __invoke - Stack Overflow

    PHP does not allow the passing of function pointers like other languages. Functions are not first class in PHP. Functions being first class mainly means that you can save a function to a …

  7. Practical applications of PHP magic methods - Stack Overflow

    May 12, 2011 · Since magic methods can save you a LOT of coding when it comes to repetitive tasks like defining members, populating them and then retrieving them - instead of doing that …

  8. Casting object to array - any magic method being called?

    Dec 27, 2012 · In specific cases, when the object is not used for anything else, you can use the magic method __invoke type-hinted to array to tell PHP to use the object as array.

  9. What are the advantages of using getters and setters instead of ...

    The main problem with PHP's implementation is that magic methods are called for all inaccessible properties. Which means you have to Repeat Yourself (eg. by calling property_exists ()) in the …

  10. oop - PHP magic methods in various scopes - Stack Overflow

    Nov 5, 2017 · I've been reading up on PHP magic methods and trying to better understand them. From the PHP manual it states: The overloading methods are invoked when interacting with …