note 33694 rejected from function.require by sp
| From: | sp@php.net | Date: | Fri, 04 Jul 2003 06:45:49 +0000 |
| Subject: | note 33694 rejected from function.require by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51496@lists.php.net to get a copy of this message | ||
Note Submitter: greywire@peoplecatcher.net
----
Contrary to the previous poster's experience (which is also exactly what I want to happen),
this does not seem to work for me. A class declared in an included file from within a function does
not seem to be available outside the function. This is with PHP 4.3.2 on a windows box. Perhaps
its works in linux??
Easy test:
function test() {
class duh { var $d; }
$a = new duh; // This works,
}
$a = new duh; // while this does not
What gives? Can it be done or not, and how?