This website recently got a major rebuild; if you're missing something, let Lorna know.

    Tag: magic method


  1. 9 Magic Methods in PHP


    This post forms part of a series of articles about using PHP to do objected oriented programming, or OOP. They were originally published elsewhere but are no longer available at that location, so I'm reposting them here. Previously in the series was an introduction to OOP in PHP, in two parts

    The title is a bit of a red herring as PHP has more than 9 magic methods, but these will get you off to a good start using PHP's magic methods. It might be magic, but no wands are required!

    Read more

  2. PHP's Magic __invoke() Method and the Callable Typehint


    PHP has a variety of magic methods; methods named with two underscores at the start, which get called automatically when a particular event happens. In PHP 5.3, a new magic method was added: __invoke().

    Read more