Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Magic Constants Case Sensitive or case In-sensitive ?

magic constant

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 uniqueideaman

uniqueideaman

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 27 April 2017 - 05:58 AM

Experts,
 
I do not understand this atall.
Here:
 
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.


#2 uniqueideaman

uniqueideaman

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 28 April 2017 - 06:25 AM

Nah! I was mistaken in understanding it. I never should have opened this thread. It can be closed.

There was no contradiction the tutorial as in one part they talk about magic constants names and on other parts about their values and I got my wires crossed somewhere.



#3 uniqueideaman

uniqueideaman

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 28 April 2017 - 01:12 PM

This thread can now be closed


Edited by uniqueideaman, 28 April 2017 - 01:26 PM.