PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun May 28, 2017 7:14 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Apr 27, 2017 8:52 am 
Offline
Forum Commoner

Joined: Wed Jan 18, 2017 4:43 pm
Posts: 94
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.


Top
 Profile  
 
PostPosted: Thu Apr 27, 2017 9:32 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6423
Location: WA, USA
The names of the constants are insensitive. The values of the constants are sensitive.


Top
 Profile  
 
PostPosted: Fri Apr 28, 2017 9:22 am 
Offline
Forum Commoner

Joined: Wed Jan 18, 2017 4:43 pm
Posts: 94
I think you are right. Others tell me this also. I suspected as such.

Thanks!


Top
 Profile  
 
PostPosted: Fri Apr 28, 2017 4:13 pm 
Offline
Forum Commoner

Joined: Wed Jan 18, 2017 4:43 pm
Posts: 94
This thread can now be closed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group