include, include_once bug or feature ?
| From: | Pavel Plesov | Date: | Thu, 14 Mar 2002 12:55:53 +0000 |
| Subject: | include, include_once bug or feature ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88485@lists.php.net to get a copy of this message | ||
Hello!
I have a trouble :(
When I try this:
--[index.php]--
<?php
function f($action)
{
switch($action){
case 'one': include_once('M/one.php'); break;
}
}
f('one');
?>
--------------
--[M/one.php]--
<?php
print "<pre>\n";
print_r(get_defined_vars());
print "</pre>\n";
?>
------
At output i'll gets nothing :(
No any global variables.
But, at index.php I get it all.
If I move include() to global scope, all ok.
It's feature, or bug ?
--
Pavel Plesov
Simpage support