Re: require_once dying silently

From: Date: Wed, 09 Apr 2008 15:00:49 +0000
Subject: Re: require_once dying silently
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-272789@lists.php.net to get a copy of this message
Greg Bowser írta:
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
I stand corrected, I just tried putting an object property into double quotes and it works greets, Zoltán Németh
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.


« previous php.general (#272789) next »