Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:17:46+00:00 2026-06-04T20:17:46+00:00

How do I access a constant which name was declared with a dot (eg.:

  • 0

How do I access a constant which name was declared with a dot (eg.: SOME.CONSTANT), without using the “constant” function?

The main reason for that, is so I can declare a class property like this:

class Classname {
  public $variable = SOME.CONSTANT; // Can't use "constant('SOME.CONSTANT')" here
}

And yet: any particular reason I should avoid the use of dots in constant names? I just started using it so I could create some kind of “namespace” for constants, as in AUTHCONTROL.ACCESSLEVEL.ADMIN

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:17:48+00:00Added an answer on June 4, 2026 at 8:17 pm

    It’s probably better to use _ as a namespace separator in constant names. Examples include E_USER_ERROR, M_PI and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Access 2003 In my table column, some of the fields are null, some
Using Access 2003 Table1 ID Name Value 001 Raja 100 002 Ramu 200 004
Is there a setting by which I can get some scripts to load/execute automatically
I wanted to know is C# array has a constant access speed? I need
Are models available within the modules. Can I access constants stored in a model
Which access modifiers which when used with the method makes it available to all
Using Access 2003 I want to get a table value from the two databases
Using Access 2003 Database Table1 Intime Outtime WorkTime OverTime 08:00:00 19:00:00 09:00:00 02:00:00 09:00:00
I have a whole slew of database access functions which assume a particular connection
I have a variable $entry which is set to: stdClass Object ( [im:name] =>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.