Re: require_once dying silently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux