|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-20 18:23 UTC] jani@php.net
[2009-04-20 22:46 UTC] info at rkphoto dot co dot uk
[2009-04-20 23:32 UTC] info at rkphoto dot co dot uk
[2009-04-21 12:45 UTC] fa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Apr 16 06:00:02 2026 UTC |
Description: ------------ The require function produces a fatal error or expects arguments that have been removed from previous versions of the 'included' functions Reproduce code: --------------- Calling code: <?php require('includes/mainMenu2.php'); ?> <html> <head></head> <body><?php mainMenu(); ?></body> </html> Test Code in mainMenu2.php: function mainMenu() { echo 'mainMenu() called'; } Expected result: ---------------- mainMenu() called Actual result: -------------- Warning: require(includes/mainMenu2.php) [function.require]: failed to open stream: No such file or directory in /Library/WebServer/Documents/rk/require2.php on line 1 Fatal error: require() [function.require]: Failed opening required 'includes/mainMenu2.php' (include_path='.:/usr/local/lib/php') in /Library/WebServer/Documents/rk/require2.php on line 1 ____________________ This was the second incarnation of the problem - the first time I was working with mainMenu,php, and calling mainMenu() with one argument. I had the same error as above, but later this morphed into the error below after it dropped the fatal error and just decided to object to the argument change instead. Warning: Missing argument 1 for mainMenu(), called in /Library/WebServer/Documents/rk/require.php on line 4 and defined in /Library/WebServer/Documents/rk/includes/mainMenu.php on line 2 Matching the arguments stops this error message, but produces truncated html as the view source shows: <html> <head></head> <body>