ID: 37030 User updated by: stevenmoss at gmail dot com Reported By: stevenmoss at gmail dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: Ubuntu 6.06 PHP Version: 5.1.2 New Comment:
Thankyou for the swift response. I must say I'm bewildered if this is the intended behaviour of PHP. Why would it be ok for PHP to treat all the code within an included file as though it were within the including file EXCEPT for return values? The return statement DOES execute (I have other examples which prove this), why then is it logical that it should not also return the value assigned to it? This is very important for me because I have large objects with many functions which are difficult to manage unless split over many files. This behaviour would seem to make it impossible for me to do so. P.S. I have read the relevant documentation for program structure and the behaviour of include/require etc. before I submitted the bug report and it seems to back me up. Thanks, S Previous Comments: ------------------------------------------------------------------------ [2006-04-10 13:12:01] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2006-04-10 13:10:01] stevenmoss at gmail dot com Description: ------------ This bug was first reported (coincidentally) exactly one year ago as bug #32657 in Version 5.0.4, it was deemed bogus. I believe that judgement was in error. Reproduce code: --------------- "Test.php" <?php Class TestObject { function ReturnTest() { require("ReturnTest.php"); } } $oTest = New TestObject(); Echo $oTest->ReturnTest(); ?> "ReturnTest.php" <?php return "Test"; ?> Expected result: ---------------- "Test" should be output Actual result: -------------- No output ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37030&edit=1