php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69308 return description misleading
Submitted: 2015-03-26 14:06 UTC Modified: 2015-12-18 21:32 UTC
From: cmb@php.net Assigned: tpunt (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2015-03-26 14:06 UTC] cmb@php.net
Description:
------------
---
From manual page: http://www.php.net/function.return
---
The following description is misleading:

| return returns program control to the calling module. Execution
| resumes at the statement following the called module's invocation.

Consider a compound expression, where return will not cause
execution to resume with the next *statement*, but rather with the
next (not necessarily lexically, but rather in order of evaluation
precedence) *expression*:

  echo my_trim('hello') . my_trim('world');



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-18 21:31 UTC] tpunt@php.net
Automatic comment from SVN on behalf of tpunt
Revision: http://svn.php.net/viewvc/?view=revision&revision=338310
Log: Resolve doc bug #69308
 [2015-12-18 21:31 UTC] tpunt@php.net
-Assigned To: +Assigned To: tpunt
 [2015-12-18 21:32 UTC] tpunt@php.net
I've resolved this by changing "statement" to "expression", since control of execution will always be passed back into an expression context:
"Execution resumes at the expression following the called module's invocation."

Commit: https://svn.php.net/viewvc?view=revision&revision=338310
 [2015-12-18 21:32 UTC] tpunt@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 14:00:01 2026 UTC