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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugs dot php dot net at ignaciollorente dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC