wp-config icon indicating copy to clipboard operation
wp-config copied to clipboard

Disallow numeric constant name

Open tangrufus opened this issue 5 years ago • 2 comments

close #4

Note: There are a few more constant names will break, e.g: null, true, false. Haven't think of a good way to catch them all.

tangrufus avatar Mar 13 '20 14:03 tangrufus

Pull Request Test Coverage Report for Build 39

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 38: 0.0%
Covered Lines: 19
Relevant Lines: 19

💛 - Coveralls

coveralls avatar Mar 13 '20 15:03 coveralls

Update: I just noticed that you mentioned this in #4 and the intention of this PR is to disable that behavior anyway.

Fair enough. 😅


It's technically valid to use numeric constants. You can access them using the constant() function.

image

null, true, and false are already predefined constants, so they should already fail if a user attempts to redefine them.

image

QWp6t avatar Apr 28 '21 17:04 QWp6t