#46608 [Tbd->Csd]: Return() Not Documented Correctly

From: Date: Mon, 23 Nov 2009 21:17:29 +0000
Subject: #46608 [Tbd->Csd]: Return() Not Documented Correctly
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3325@lists.php.net to get a copy of this message
ID: 46608 Updated by: bjori@php.net Reported By: php at info-svc dot com -Status: To be documented +Status: Closed Bug Type: Documentation problem Operating System: Linux 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. The manual does say that: "Note: If no parameter is supplied, then the parentheses must be omitted and NULL will be returned. Calling return() with parentheses but with no arguments will result in a parse error. " Previous Comments: ------------------------------------------------------------------------ [2008-12-21 09:21:23] php at info-svc dot com tag: Robert Chapin ------------------------------------------------------------------------ [2008-11-22 14:40:13] lbarnaud@php.net   ------------------------------------------------------------------------ [2008-11-18 22:52:08] php at info-svc dot com Description: ------------ I'm reporting a documentation comment that was rejected but should be valid. "Note that since return() is a language construct and not a function, the parentheses surrounding its arguments are not required." Far from optional, the parentheses actually cause an error when used as described in the documentation regarding include/require. Reproduce code: --------------- test1.php <?php require 'test2.php'; ?> test2.php <?php return(); ?> Actual result: -------------- PHP Parse error: syntax error, unexpected ')' in test2.php on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46608&edit=1

« previous php.doc.bugs (#3325) next »