|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-23 16:12 UTC] jani@php.net
[2009-04-23 22:01 UTC] neerolyte at gmail dot com
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 22:00:01 2025 UTC |
Description: ------------ Normally any return statements in a file included via require keyword will cause the require call to return what ever was passed to the return statement with in the included file. Reproduce code: --------------- include.php: <?php return "stuff from include\n"; ?> interactive code: print_r(require("include.php")); Expected result: ---------------- $ echo '<?php return "stuff from include\n"; ?>' > include.php $ php -r 'print_r(require("include.php"));' stuff from include $ php -a Interactive shell php > print_r(require("include.php")); stuff from include Actual result: -------------- $ echo '<?php return "stuff from include\n"; ?>' > include.php $ php -r 'print_r(require("include.php"));' stuff from include $ php -a Interactive shell php > print_r(require("include.php")); 1