php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76570 An uncondition
Submitted: 2018-07-03 07:11 UTC Modified: 2018-07-06 04:12 UTC
From: iyagicom at gmail dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 7.1.19 OS: ubuntu 18.04
Private report: No CVE-ID: None
 [2018-07-03 07:11 UTC] iyagicom at gmail dot com
Description:
------------
The first letter lowercase is not a constant.
Only the first capital letter should be recognized as a constant.

I am too stressed because of constants in program coding.
I hope to improve soon.


I made it in lowercase, but I get an error.	
Notice: Use of undefined constant link - assumed 'link' in /home/mall/phpmall/cc_list.php on line 83

Test script:
---------------
$arr = preg_split("/-/",$f[link]);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-03 07:17 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2018-07-03 07:17 UTC] requinix@php.net
No, constants can be in lowercase.

You need a string for the array key. Strings use quotes.

$arr = preg_split("/-/",$f["link"]);
 [2018-07-03 12:42 UTC] iyagicom at gmail dot com
I know it.
I'm not saying that.
If you write an uppercase letter as the first character in a constant grammar,
You do not have to do that.
Is not that right?

I mean, do not treat lowercase letters as constants.
 [2018-07-03 12:50 UTC] requinix@php.net
PHP does not care if it is uppercase or lowercase. What matters is how you use it.

It's true, most people name constants in uppercase, but that is not a requirement and PHP should not make it a requirement. Lowercase constants are allowed.
 [2018-07-06 04:00 UTC] iyagicom at gmail dot com
Do not you understand me?
Constant names should not be lowercase.
Exclude lowercase characters in constant names.
In the next version of PHP, allow only uppercase letters in constant names.
 [2018-07-06 04:12 UTC] requinix@php.net
-Block user comment: No +Block user comment: Yes
 [2018-07-06 04:12 UTC] requinix@php.net
No.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 02:01:36 2024 UTC