Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: The :: operator

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The :: operator

    How do they work?

    For example what does this mean:
    SomeThing::killMagicQuotes()

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The "::" operator is used to call a class' method statically. This means that you use the method as if it were a normal function, you only have to tell PHP where this function is. That's why you need to put the class name left of the operator.

    Keep in mind that when a method is called statically, there is no $this reference set. $this exists only if you call a method on the object itself.
    De gustibus non est disputandum.


  •  

    Posting Permissions

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