note 119659 added to function.return
| From: | sebi at sebi dot moe | Date: | Wed, 27 Jul 2016 14:16:26 +0000 |
| Subject: | note 119659 added to function.return | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206116@lists.php.net to get a copy of this message | ||
One situation where returning a value from a script and using it could be considered a good use is
config files. Zend Framework 2 promotes this structure for this purpose, and it works pretty well.
Example config file:
<?php
return [
'site' => 123,
'settings' => 'asd'
];
Reading:
<?php
$config = (require 'config.php');
// Or
$config = array_merge(require 'config/local.php', require
'config/application.php');
----
Server IP: 72.52.91.14
Probable Submitter: 109.154.244.82
----
Manual Page -- http://php.net/manual/en/function.return.php
Edit -- https://master.php.net/note/edit/119659
Del: integrated -- https://master.php.net/note/delete/119659/integrated
Del: useless -- https://master.php.net/note/delete/119659/useless
Del: bad code -- https://master.php.net/note/delete/119659/bad+code
Del: spam -- https://master.php.net/note/delete/119659/spam
Del: non-english -- https://master.php.net/note/delete/119659/non-english
Del: in docs -- https://master.php.net/note/delete/119659/in+docs
Del: other reasons-- https://master.php.net/note/delete/119659
Reject -- https://master.php.net/note/reject/119659
Search -- https://master.php.net/manage/user-notes.php