wayne wrote:
Okay, I got a reply from a moodle user pointing
me to an archive, apparently someone had the same
question. The answer seems to be that $CFG is
an array dressed up as an object.The books that
I'm learning from don't show this concept. Could
some kind soul give an example.
Thanks.
http://php.net/manual/en/language.types.object.php
When you use the uninitialised $CFG as an object, an object of class
stdClass is created. You can then assign and read stuff to and from its
properties, basically like you said, as an "array dressed up as an object".
There's no real reason for doing this although it may be a hack because
some of the required files in that script may expect a $CFG object to exist.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php