If you're interested in some dark magic you should watch this talk by Marco Pivetta  on Voodoo PHP.  I really like these show-me-the-code type of talks.

We've often seen "magic" code, but how does it even work? Let's explore some arguably bad PHP coding techniques that are actually used in real world libraries to solve problems that would otherwise be a huge burden for all of us.