note 30279 deleted from function.require by sniper
| From: | sniper@php.net | Date: | Tue, 04 Nov 2003 00:44:26 +0000 |
| Subject: | note 30279 deleted from function.require by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59813@lists.php.net to get a copy of this message | ||
Note Submitter: petej-NO-SPAM-at-shaman-dot-ca
----
If you use (require|include)[_once], to return values, like so:
. . .
$val = require('foo.php');
. . .
you may encounter problems, including Apache seg faults, when using this returned value. For
example, if the aforementioned foo.php looks like this:
. . .
return array(1,2,3);
. . .
and you use the $val for something, it may not contain the value you expect it to, or it may seg
fault your php process. Regardless of the action it causes, you can prevent it by doing this
instead:
. . .
$ret = array(1,2,3);
return $ret;
. . .
Very annoying gotcha...