<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp" -->

---
title: When to Use Static Methods | daily.dev
description: Static methods are not inherently bad — the key distinction is whether they are stateless or stateful. Stateless static methods like named constructors or pure...
canonical: https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: When to Use Static Methods | daily.dev
og:description: Static methods are not inherently bad — the key distinction is whether they are stateless or stateful. Stateless static methods like named constructors or pure...
og:url: https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp
og:image: https://api.daily.dev/og/posts/CsHzR8zlp.png
og:image:alt: When to Use Static Methods
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# When to Use Static Methods

**[Mathias Verraes](https://daily.dev/sources/verraes)** · 3 min read · 0 upvotes · 0 comments

## Summary

Static methods are not inherently bad — the key distinction is whether they are stateless or stateful. Stateless static methods like named constructors or pure utility functions (e.g., Calculator::sum) are referentially transparent, predictable, and free of side effects, making them perfectly valid. Stateful static methods that share global state across callers cause unpredictable bugs and should be replaced with proper object instances. Static methods also have a functional programming advantage over operators in PHP: they can be passed as callables to higher-order functions like array_reduce.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://verraes.net/2014/06/when-to-use-static-methods-in-php>

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#php](https://daily.dev/tags/php), [#functional-programming](https://daily.dev/tags/functional-programming)

[View this post on daily.dev](https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"When to Use Static Methods","url":"https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp"},"datePublished":"2026-06-17T11:25:37.865Z","dateModified":"2026-06-17T11:26:55.219Z","description":"Static methods are not inherently bad — the key distinction is whether they are stateless or stateful. Stateless static methods like named constructors or pure...","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"Mathias Verraes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Mathias Verraes","logo":"https://media.daily.dev/image/upload/s--EgKQUiOd--/f_auto,q_auto/v1781695533/logos/verraes?_a=BAMAMiWQ0","url":"https://daily.dev/sources/verraes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/when-to-use-static-methods-cshzr8zlp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"general-programming,php,functional-programming","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Mathias Verraes","item":"https://daily.dev/sources/verraes"},{"@type":"ListItem","position":3,"name":"When to Use Static Methods"}]}
```

