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.
Magic Constants Case Sensitive or case In-sensitive ?
Moderator: General Moderators
-
UniqueIdeaMan
- Forum Contributor
- Posts: 197
- Joined: Wed Jan 18, 2017 3:43 pm
Re: Magic Constants Case Sensitive or case In-sensitive ?
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 ?
I think you are right. Others tell me this also. I suspected as such.
Thanks!
Thanks!
-
UniqueIdeaMan
- Forum Contributor
- Posts: 197
- Joined: Wed Jan 18, 2017 3:43 pm
Re: Magic Constants Case Sensitive or case In-sensitive ?
This thread can now be closed.