> BM>> include_once as i have already stated is useless inside of a
> BM>> function. Variables in the file are not global.  And, I cannot
>
> Why include_once inside a function is different from include inside a
> function?

Because once include_once is used on a file, include_once won't include the
file again.  Include will include the file again.  And we as coders can
determine if the file needs to be included based on what we put in it.

> BM>> include it again with include_once.  The example I gave is not
> BM>> acurate to how we use it.  We actually use a variable, not a
> BM>> define to control the inclusion of a file.
>
> Can you explain this further? How comes that include_once is not enough to
> prevent double include and ensure the function is defined?

It is not a matter of the functions.  If everything were a function or class
( like Java ) this would not be an issue.  But, we have variables and such
in these files that prevent us from be able to trust include_once.

> BM>> The other thing is that backward compatiblity was broken when it
> BM>> did not have to be.  include_once is a *new* function in PHP to
> BM>> lots of people.
>
> There's a backward compatibility and there's a bug-compatibility. The PHP
> always worked so that you cannot redefine functions once defined (we'll
> leave ZE2 discussions about function ovverides alone for now). If there
> was a bug that allowed to do it, it's a logical thing to fix it, not to
> drag it through versions as if it should be so.

And my fix will keep a function from being defined twice.  It will simply
also allow people who have become accustomed to using the language this way
to keep doing it.

Brian Moon
------------------------------------------
dealnews.com, Inc.
Makers of dealnews & dealmac
http://dealnews.com/ | http://dealmac.com/



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to