Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 773415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:57:38+00:00 2026-05-14T18:57:38+00:00

I always see people in serious projects use :: everywhere, and -> only occasionally

  • 0

I always see people in serious projects use :: everywhere, and -> only occasionally in local environment.

I only use -> myself and never end up in situations when I need a static value outside of a class. Am I a bad person?

As I understand, the only situation when -> won’t work is when I try following:

class StaticDemo {  
    private static $static  
}

$staticDemo = new StaticDemo( );

$staticDemo->static; // wrong  
$staticDemo::static; // right

But am I missing out on some programming correctness when I don’t call simple public methods by :: ?

Or is it just so that I can call a method without creating an instance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:57:39+00:00Added an answer on May 14, 2026 at 6:57 pm

    :: is for referencing static properties or methods of a class. -> is for referencing instance properties and methods. You aren’t missing out on any programming correctness, and if you are a bad person then it isn’t because of this. Which one you use depends on the purpose of your class and how its written. But also, PHP didn’t have namespaces until very recently so many people encapsulated their code in static classes to emulate namespaces to avoid naming collisions. It is possible you are seeing code that does that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always see people mention that Python binding and C Sharp binding etc. when
Hi Stackoverflow people, In the past, I always developed my Django projects locally with
I always see people using Thread.Sleep() for creating delays in processing or something similar
I always see people writing C# and C#.NET. What is the correct name of
I always see people talking at GoogleIO or WWDC about how drawing the screen(bits/pixels)
What kind of server do you people see in real projects? 1) Web Services
I always see people giving me code (I mean code examples for questions on
Ok I admit I always see people griping about IE (Internet Explorer xx) and
When people create elements with jQuery I always see them do something along the
I always see the word node . As far as I know node means

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.