Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //index.php
- <?php
- require_once('function.php');
- require_once('config.php');
- echo $myHomeVarable;
- doTestFuntion();
- ?>
- //function.php
- <?php
- function doTestFuntion()
- {
- //require_once('config.php');// Causes PHP Notice: Undefined variable: myFunctionVarable in /srv/www/htdocs/fwstest/function.php on line 7
- require('config.php');//Causes PHP Fatal error: Cannot redeclare trapFunction() (previously declared in /srv/www/htdocs/fwstest/config.php:8) in /srv/www/htdocs/fwstest/config.php on line 9
- echo $myFunctionVarable;
- }
- ?>
- //config.php
- <?php
- $myHomeVarable = 'Home Works';
- $myFunctionVarable = 'Function Works';
- function trapFunction()
- {
- echo'boo';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement