note 96792 added to function.require-once
| From: | maxime dot faye at gmail dot com | Date: | Tue, 16 Mar 2010 14:24:42 +0000 |
| Subject: | note 96792 added to function.require-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167094@lists.php.net to get a copy of this message | ||
Note that require_once() does NOT work with return value as require() does :
<?php
//include.inc.php
$aConf = array('ConfValue' => true);
return $aConf;
//main.php
$aConfArray = require_once('include.inc.php');
print_r($aConfArray);
//Will display '1' and not 'array([ConfValue] => 1)'
?>
----
Server IP: 69.147.83.197
Probable Submitter: 80.89.121.10
----
Manual Page -- http://www.php.net/manual/en/function.require-once.php
Edit -- https://master.php.net/note/edit/96792
Del: integrated -- https://master.php.net/note/delete/96792/integrated
Del: useless -- https://master.php.net/note/delete/96792/useless
Del: bad code -- https://master.php.net/note/delete/96792/bad+code
Del: spam -- https://master.php.net/note/delete/96792/spam
Del: non-english -- https://master.php.net/note/delete/96792/non-english
Del: in docs -- https://master.php.net/note/delete/96792/in+docs
Del: other reasons-- https://master.php.net/note/delete/96792
Reject -- https://master.php.net/note/reject/96792
Search -- https://master.php.net/manage/user-notes.php