SitePoint Sponsor

User Tag List

Results 1 to 25 of 25

Thread: what this === ?

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what this === ?

    can some one tell me?

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    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.

  3. #3
    SitePoint Addict
    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

  4. #4
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what this :: ?

    two semi colons means ?

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    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(); 
    For more details:
    http://www.php.net/manual/en/languag...ekudotayim.php
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  6. #6
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajug View Post
    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(); 
    For more details:
    http://www.phpbuilder.com/manual/en/...ekudotayim.php
    What is public static in that code ?

  7. #7
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    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.php
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  8. #8
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajug View Post
    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.php
    cmon, just give an idea what it means or does, I am tired of reading too much already.

  9. #9
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Static method is a Class method.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  10. #10
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In c++ it is scope resolution operator

  11. #11
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jim_il View Post
    In c++ it is scope resolution operator
    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.php
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  12. #12
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what this __ ?

    Can you tell me ?

  13. #13
    Nicking the Bevel Highway Seven's Avatar
    Join Date
    Nov 2008
    Location
    The Open Road
    Posts
    350
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by runrunforest View Post
    what this ==?
    Quote Originally Posted by runrunforest View Post
    what this ::?
    Quote Originally Posted by runrunforest View Post
    what this __?
    Dude...
    Daniel

  14. #14
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dcfauno View Post
    Dude...
    Jesus. Dude you collected all my questions, you must want sell them for 10 buck when i died, don't you ?

    Picaseu.

    Quote Originally Posted by SilverBulletUK View Post
    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!
    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 .

  15. #15
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    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.

  16. #16
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 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.....

  17. #17
    SitePoint Addict
    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 ~

  18. #18
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NateL View Post
    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.
    That makes two of us, according to post.

  19. #19
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NateL View Post
    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.
    If any of the symbols or special characters is used in any programming language, that must be called 'operators' of that language. So if you type 'php operators' in google, it will show you the link/url of php manual's operators page.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  20. #20
    SitePoint Wizard bronze trophy
    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.

  21. #21
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks heap.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •