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 546253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:50:51+00:00 2026-05-13T10:50:51+00:00

Possible Duplicate: When should I use static methods in a class and what are

  • 0

Possible Duplicate:
When should I use static methods in a class and what are the benefits?

I’m working in PHP right now.

I’m working on two groups of Functions.

I have a class which consists of Date Handling Functions.

In this class I have no need for properties as each function/method is more or less a utility. As such I have made my class’ functions all static.

I have a couple questions from here.

1) What benefits are there from using Static methods? I understand that there is lower processing overhead because there is not an Object. I’ve also heard this is negligible (depending).

2) What other types of functions/methods would be good candidates for “static” besides utilities?

Thanks

  • 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-13T10:50:51+00:00Added an answer on May 13, 2026 at 10:50 am

    The key concept of using static methods is that they are bound to a class, not an instance of the class. A good guideline is that **anything requiring state is not suitable to being used statically*.

    Utility methods are definitely a good candidate for static usage, as they are often short and require no state. Some other guidelines might be:

    • Input and output are not reliant on anything except each other.
    • The method has no context, that is, it doesn’t make sense to associate it with an instance of an object.
    • A method/variable requires no differentiation between objects, and a single declaration is all that is required. This applies mostly to static class variables, such as a counter that is shared across all instantiated objects.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 293k
  • Answers 293k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try the following: File schemaFile = new File("schema.xsd"); File xmlFile… May 13, 2026 at 6:26 pm
  • Editorial Team
    Editorial Team added an answer Guava's CacheBuilder class allows you to do this easily. CacheBuilder.newBuilder().weakKeys().build()… May 13, 2026 at 6:26 pm
  • Editorial Team
    Editorial Team added an answer I'm not sure there is a specific name for it,… May 13, 2026 at 6:26 pm

Related Questions

Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: Should I use static_cast or reinterpret_cast when casting a void* to whatever
Possible Duplicate: When should I use the new keyword in C++? When should I
Possible Duplicate: When to choose checked and unchecked exceptions When should I create a
Possible Duplicate: Should I use Elements or Attributes in XML? I'm writing a configuration

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.