SOLVED: Global class instances mysteriously set to NULL

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

 



I *really* appreciate everybody's previous input. I may be a highly experienced programmer, but am relatively new to PHP.

OK, I figured out what was going on. Google enough and read enough and the light goes on finally.

The problem was not the "require_once" but a scoping problem. Specifically, I was calling "require_once" /from within a function/.

Bad! Bad! Bad!

The included source file was also including other files... thus the global class instance was just fine... it was simply hidden due to scoping rules.

Yikes! I was really pulling my hair out when entire global functions were "disappearing" due to the screwed up scope.

I finally figured out the problem in the "User Contributed Notes" section of the PHP manual (http://www.php.net/language.variables.scope).

THANK YOU again...

--
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