note 83176 deleted from function.include by danbrown

From: Date: Mon, 18 May 2009 00:55:57 +0000
Subject: note 83176 deleted from function.include by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155451@lists.php.net to get a copy of this message
Note Submitter: phpnet at freshsite dot de ---- A note about the "return - thing": test2.php <?php $r = true; return $r; ?> test1.php: (Does NOT work) <?php function functionA(){ return functionB(); } function functionB(){ require_once 'test2.php'; } var_dump(functionA()); ?> When you call test1.php, result will be NULL. You have to "return" the include like this: test1.php CORRECT: <?php function functionA(){ return functionB(); } function functionB(){ return require_once 'test2.php'; } var_dump(functionA()); ?>

« previous php.notes (#155451) next »