#23249 [Opn->Bgs]: contradiction in manual

From: Date: Thu, 17 Apr 2003 18:09:28 +0000
Subject: #23249 [Opn->Bgs]: contradiction in manual
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352635@lists.php.net to get a copy of this message
ID: 23249 Updated by: jmcastagnetto@php.net Reported By: prof_moriart at veryfast dot biz -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: win 98 PHP Version: 4.3.0 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2003-04-16 19:02:19] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23249&edit=1

« previous php.doc (#969352635) next »