Using php's magic methods outside a class

Posted by Greelmo on Stack Overflow See other posts from Stack Overflow or by Greelmo
Published on 2010-04-24T03:05:04Z Indexed on 2010/04/24 3:13 UTC
Read the original article Hit count: 358

Filed under:
|
|
|

Is it possible to use PHP magic methods (specifically __get()) outside a defined class?

I'm wanting to use it in a configuration file for quick loading. The configuration file has a single array, $config, with many keys. Therefore, I'd like to override __get() to return the key in the array.

© Stack Overflow or respective owner

Related posts about php

Related posts about magic