Re: require_once dying silently
| From: | Greg Bowser | Date: | Wed, 09 Apr 2008 12:38:43 +0000 |
| Subject: | Re: require_once dying silently | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-272781@lists.php.net to get a copy of this message | ||
>the above won't work, as the parser will try to interpret $CFG and
put it in the string first,
In that case, $CFG is either null, or it is indeed an object. If it is
a standard object, which I it appears to be, then a fatal error will
be thrown because there is no __tostring() function. If it's null,
then require_once is referencing a directory beginning with '->',
again, there *should* be an error. Anyway..
I've seen $obj->property used many times in double quotes, and never
had a problem with that working. Personally though, I always use the
curly braces though because it highlights better in VIM :p
>Also, OOP is nice and all (not to start a thread about OOP again),
but putting your config into an object seems a bit overdo to me.
Me too!! (not to continue the unstarted OOP discussion) It's a
practice I've seen used more than once. I think people find that
syntax attractive.