Magic Constants Case Sensitive or case In-sensitive ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
UniqueIdeaMan
Forum Contributor
Posts: 197
Joined: Wed Jan 18, 2017 3:43 pm

Magic Constants Case Sensitive or case In-sensitive ?

Post by UniqueIdeaMan »

Experts,

I do not understand this atall.
Here:
https://www.tutorialspoint.com/php/php_constants.htm

It says:
"PHP Magic constants
PHP provides a large number of predefined constants to any script which it runs.

There are five magical constants that change depending on where they are used. For example, the value of __LINE__ depends on the line that it's used on in your script. These special constants are case-insensitive and are as follows −".


__CLASS__

The class name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the class name as it was declared (case-sensitive). In PHP 4 its value is always lowercased.

__METHOD__

The class method name. (Added in PHP 5.0.0) The method name is returned as it was declared (case-sensitive).


Seems like contradiction to me. Firs they say case-insensitive. Then in their 2 examples they mention they are case-sensitive. What is going on ? I need some good explanation with a min of 2 good examples to understand any of this.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Magic Constants Case Sensitive or case In-sensitive ?

Post by requinix »

The names of the constants are insensitive. The values of the constants are sensitive.
UniqueIdeaMan
Forum Contributor
Posts: 197
Joined: Wed Jan 18, 2017 3:43 pm

Re: Magic Constants Case Sensitive or case In-sensitive ?

Post by UniqueIdeaMan »

I think you are right. Others tell me this also. I suspected as such.

Thanks!
UniqueIdeaMan
Forum Contributor
Posts: 197
Joined: Wed Jan 18, 2017 3:43 pm

Re: Magic Constants Case Sensitive or case In-sensitive ?

Post by UniqueIdeaMan »

This thread can now be closed.
Post Reply