php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79303 Short arrow functions are not documented in "Anonymous functions"
Submitted: 2020-02-24 17:00 UTC Modified: 2020-04-26 12:41 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: tandre@php.net Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.4.3 OS:
Private report: No CVE-ID: None
 [2020-02-24 17:00 UTC] tandre@php.net
Description:
------------
https://www.php.net/manual/en/functions.anonymous.php doesn't seem to document https://wiki.php.net/rfc/arrow_functions_v2#proposal

It was accepted in php 7.4.

I don't see references to the syntax `fn(parameter_list) => expr` in that page, or similar issues in bugs.php.net

Expected result:
----------------
Short arrow function syntax is documented on https://www.php.net/manual/en/functions.anonymous.php or a page in the "Functions" section of the language reference


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-04-24 21:00 UTC] jessedickey at gmail dot com
Yeah, arrow functions are completely missing from the PHP manual. It is briefly mentioned as a new feature of PHP 7.4 on php.net, but I don't consider explanations of features of a new version to be part of the actual manual. Is there some way to prevent this from happening again with other upcoming new features? It should not be possible to add new features without documenting how they work in the manual. People shouldn't have to look at the RFC to find out how it works after it is part of the language.
 [2020-04-26 01:31 UTC] tandre@php.net
The following pull request has been associated:

Patch Name: Document PHP 7.4 arrow functions
On GitHub:  https://github.com/php/doc-en/pull/71
Patch:      https://github.com/php/doc-en/pull/71.patch
 [2020-04-26 12:41 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed May 27 22:00:02 2026 UTC