php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80265 Can't use defined "Fn"
Submitted: 2020-10-21 06:18 UTC Modified: 2020-10-21 06:33 UTC
From: bugs dot php dot net at ignaciollorente dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.4.11 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 + 48 = ?
Subscribe to this entry?

 
 [2020-10-21 06:18 UTC] bugs dot php dot net at ignaciollorente dot com
Description:
------------
The word Fn can used after defined.
It gives a syntax error.


Test script:
---------------
<?php 
define("Fn","hola");
#Parse error: syntax error, unexpected ';', expecting '(' in xxxx on line 4
echo Fn;
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-21 06:24 UTC] bugs dot php dot net at ignaciollorente dot com
It seems to be related to Arrow Functions https://www.php.net/manual/en/functions.arrow.php

Documentation does not show results when searching "fn"
https://www.php.net/manual-lookup.php?pattern=fn&scope=quickref
 [2020-10-21 06:25 UTC] sjon@php.net
-Status: Open +Status: Not a bug
 [2020-10-21 06:25 UTC] sjon@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

"fn" has been a reserved keyword ever since "arrow functions" were introduced

https://www.php.net/manual/en/functions.arrow.php
 [2020-10-21 06:26 UTC] requinix@php.net
-Package: Compile Failure +Package: *General Issues
 [2020-10-21 06:33 UTC] bugs dot php dot net at ignaciollorente dot com
-Summary: Can't us defined "Fn" +Summary: Can't use defined "Fn"
 [2020-10-21 06:33 UTC] bugs dot php dot net at ignaciollorente dot com
Edited Title
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 17 13:03:48 2022 UTC