#50208 [Opn->Csd]: Needs explicit statement on falling off the end of a function
| From: | bjori@php.net | Date: | Mon, 23 Nov 2009 21:02:12 +0000 |
| Subject: | #50208 [Opn->Csd]: Needs explicit statement on falling off the end of a function | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3322@lists.php.net to get a copy of this message | ||
ID: 50208
Updated by: bjori@php.net
Reported By: mwood at IUPUI dot Edu
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: any
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-11-23 21:01:57] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=291230
Log: Fixed bug#50208 (Needs explicit statement on falling off the end
of a function)
------------------------------------------------------------------------
[2009-11-17 19:17:00] mwood at IUPUI dot Edu
Description:
------------
There is no official statement of the meaning of exiting a function
other than through a 'return' statement. Specifically, it is possible
to execute to the end of the function, but then what is the value of
that invocation?
Reproduce code:
---------------
---
From manual page: language.functions
---
Not in "returning values" or "return()" either. "Returning values" is
probably the best place for it.
Expected result:
----------------
Since many other languages will use the value of the last expression
evaluated as the return value of a function which does not explicitly
'return', it would be helpful to note prominently that PHP (apparently)
does not do this. It seems that the value of an invocation of such a
function is NULL.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50208&edit=1