php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #23249 contradiction in manual
Submitted: 2003-04-16 19:02 UTC Modified: 2003-04-17 13:09 UTC
From: prof_moriart at veryfast dot biz Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.3.0 OS: win 98
Private report: No CVE-ID: None
 [2003-04-16 19:02 UTC] prof_moriart at veryfast dot biz
I believe i've found a contradiction in the manual (this can be found in the online manual).

This is what it says in the documentation for the require function:
"require() and include() are identical in every way except how they handle failure."


And Now quoting from:
Appendix b: Migrating from PHP 3 to PHP 4
Sub-section: Parser behavior

"Another thing no longer possible, though rarely seen in PHP 3 code is returning values from a required file. Returning a value from an included file is still possible."


There'a  fair chance i'm mis-understanding the meaning of 'required' and 'included' files, as refered to in the 'parser behaviour' quote, however what appears to be the case is that it's saying that it's possible to use the

return
feature from included files, but not from require files.
After a small amount of testing i can see that both the 'require' and 'include' functions are able to return things to a calling script.

So the 'parser behaviour' section is either inacurate, or unclear.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-17 13:09 UTC] jmcastagnetto@php.net
Not really a contradiction as the text of the main manual refers to the 
current release (i.e. PHP 4), whereas the behaviour of returning values 
(i.e. using "return $foo;" as the last line of a included file), is related to 
PHP3. 
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 03:01:28 2024 UTC