PHP 4.0 Bug #9304 Updated: require function generates error

From: Date: Fri, 16 Feb 2001 20:10:50 +0000
Subject: PHP 4.0 Bug #9304 Updated: require function generates error
Groups: php.dev 
Request: Send a blank email to php-dev+get-46753@lists.php.net to get a copy of this message
ID: 9304 User Update by: flash@drewnels.net Status: Open Bug Type: Scripting Engine problem Description: require function generates error this error happens on all these commands: include() include_once() require() require_once() Previous Comments: --------------------------------------------------------------------------- [2001-02-16 14:55:07] flash@drewnels.net this error happens on all these commands: include() include_once() require() require_once() --------------------------------------------------------------------------- [2001-02-16 14:46:38] flash@drewnels.net in the documentation the following is noted: require() is not actually a function in PHP; rather, it is a language construct. It is subject to some different rules than functions are. For instance, require() is not subject to any containing control structures. I have found this statement ("not subject to any containing control structures") to NOT be true. I get an error for the following: class myclass() { require("myfile.php") }; I want to be able to include a function from another file that will become a method for the class. Any suggestions? --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=9304

« previous php.dev (#46753) next »