note 61389 rejected from language.variables.scope by nlopess
| From: | nlopess@php.net | Date: | Thu, 02 Feb 2006 19:55:05 +0000 |
| Subject: | note 61389 rejected from language.variables.scope by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102890@lists.php.net to get a copy of this message | ||
Note Submitter: php at rebel dot com dot au
----
Daft Truly Daft
PHP is frustrating, you seemed to spend 1/2 your time working around "unusual" design
decisions such as having to declare globals as global before you can access them.
this causes problems.
For instance. if while inside a function or class scope you are required to call a third party
script using include('3rdparty.php').
That third party script then defines 'global' variables
Now a function within that 3rd party script wants to access those variables, so it does the right
thing and predeclares the variable with 'global' ie:
global $globalvar;
But guess what, because the script was included inside your class those so called global variables
are not actually global variables any more and the function fails.
any ideas on a fix?
my attempts have only produced redeclaration errors.
If there is a way around this it NEEDS to be documented
By the way most of these issues have been solved in other languages. why does PHP repeat the errors
of history?