SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 25
Thread: what this === ?
-
Nov 12, 2008, 09:03 #1
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what this === ?
can some one tell me?
-
Nov 12, 2008, 09:06 #2
- Join Date
- Apr 2008
- Location
- North-East, UK.
- Posts
- 6,111
- Mentioned
- 3 Post(s)
- Tagged
- 0 Thread(s)
It is one of the Comparison Operator, this one was introduced in PHP 4.
From manual:-
$a === $b | TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
-
Nov 12, 2008, 09:28 #3
- Join Date
- Jul 2008
- Location
- sudo rm -rf /
- Posts
- 386
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
$t=true;
$k=1;
if($t==$k) //same value everything except zero and false is true
echo 'true'; //outputs true
if($t===$k) //same type and value
echo 'true'; //outputs nothing
-
Nov 12, 2008, 22:01 #4
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what this :: ?
two semi colons means ?
-
Nov 12, 2008, 22:04 #5
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is called scope resolution operator used to access the static class members directly with it.
PHP Code:class Abc{
public static function myFunction(){
// do something
}
}
Abc::myFunction();
http://www.php.net/manual/en/languag...ekudotayim.phpMistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Nov 12, 2008, 22:06 #6
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 12, 2008, 22:09 #7
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can you see there?
PHP Code:........
public static function myFunction(){
..........
And better go through the details in the Page/Url i have posted above.
http://www.php.net/manual/en/languag...ekudotayim.phpMistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Nov 12, 2008, 22:14 #8
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 12, 2008, 22:34 #9
Static method is a Class method.
-
Nov 12, 2008, 23:11 #10
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
First of all, I am not a good teacher to teach you. And I don't have much time to write all the lines myself so what i can do is just copy the lines from manual and paste it here.
So better try to read there in the manual itself. Dont be lazy to read more n more and do practice.Mistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Nov 12, 2008, 23:52 #11
- Join Date
- Nov 2008
- Posts
- 20
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
In c++ it is scope resolution operator
-
Nov 13, 2008, 00:07 #12
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It is called same 'Scrop Resolution Operator' here in PHP as well. Do you mean it is said something else in PHP?
See the title of this page:
http://www.php.net/manual/en/languag...ekudotayim.phpMistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Nov 13, 2008, 08:34 #13
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what this __ ?
Can you tell me ?
-
Nov 13, 2008, 08:36 #14
-
Nov 13, 2008, 08:38 #15
- Join Date
- Apr 2008
- Location
- North-East, UK.
- Posts
- 6,111
- Mentioned
- 3 Post(s)
- Tagged
- 0 Thread(s)
runrunforest, you really need to start reading the manual. It would be a lot quicker than posing the question here, then awaiting a possible reply to your post.
The really helpful guys/gals here love to help, but they're not here to copy and paste the manual for you.
Go on, delve into the manual, you may be surprised at the wealth of additional information there!@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
-
Nov 13, 2008, 08:48 #16
- Join Date
- Aug 2004
- Location
- Manchester UK
- Posts
- 13,807
- Mentioned
- 158 Post(s)
- Tagged
- 3 Thread(s)
How very polite SilverB!
Mike Swiffin - Community Team Advisor
Only a woman can read between the lines of a one word answer.....
-
Nov 13, 2008, 08:56 #17
- Join Date
- Jan 2008
- Location
- Shaw AFB
- Posts
- 282
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've tried. have you tried googling "::" or "==" or "__" ??
apparently not.
Google strips away :: or == or __, so you won't find any results from google.
Furthermore, inside the PHP manual, when you run a search for those specific things - they do not appear. I've tried. I've tried with and without quotes and every search returns no results.
So, without having the PHP manual memorized, I really don't know where to find what those are called, so I cant search the name of what they're called to read up on how they work and what they do.
So, instead of "google it", it would be helpful if someone who already knows where to find it in the manual would post a link to the appropriate section of the manual so we can read up on it.
It would help me. I'm sure it would help others too.~ Nate L ~
-
Nov 13, 2008, 08:57 #18
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Jesus. Dude you collected all my questions, you must want sell them for 10 buck when i died, don't you ?
Picaseu.
I am not flattering anyone but answers from here are more understandable and to the point. Besides Google just giving me links to topic like this, no real reply, I don't know why.
-
Nov 13, 2008, 09:00 #19
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 13, 2008, 09:11 #20
- Join Date
- Jan 2008
- Location
- Shaw AFB
- Posts
- 282
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just FYI...my post was merged in with multiple other threads started by the OP which I did not read. To all those explaining and posting links to the manual, I appreciate your efforts.
~ Nate L ~
-
Nov 13, 2008, 09:29 #21
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Mistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Nov 13, 2008, 09:34 #22
- Join Date
- Jan 2008
- Location
- Shaw AFB
- Posts
- 282
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you. Google gave me this.
~ Nate L ~
-
Nov 13, 2008, 09:42 #23
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 13, 2008, 09:54 #24
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
__ is not an operator. All it is, is underscores. Maybe you saw them used as part of a symbol name(variable, function/method, constant). For example, the name of the class constructor method is named __construct() by convention.
here's some info on some of the symbol names php has used this naming convention for.
http://www.php.net/manual/en/languag...predefined.php
http://www.php.net/manual/en/language.oop5.magic.php
php warns it may apply "magical" functionality to symbols with this naming convention, so don't choose your own names like this. When they say magical, it means they do some stuff behind the scenes that you wouldn't expect given your otherwise correct knowledge of how php works. Like magic constants; they aren't really constants, and thier value changes throughout the script.
-
Nov 13, 2008, 10:09 #25
- Join Date
- Sep 2008
- Location
- Dubai
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks heap.
Bookmarks