February 1, 2026
Is it callable or just callable-ish?
Stop Using Pseudo-Types
PHP devs feud: “stop the fake types” vs “tell us why”
TLDR: A PHP blog says to stop using “pseudo-types” like callable and iterable, praising newer features instead. The top comment blasts it for not explaining the why and even confusing syntax, sparking a semantics-vs-practicality debate. Devs want clear, real benefits, not just a terminology cleanup.
A blog titled “Stop Using Pseudo-Types” told PHP coders to ditch labels like “callable” and “iterable,” arguing they’re not real types. It recaps how callable can be a function name, an array, or a Closure (a little function object), and how in PHP 8.2, iterable officially became a union of two real things: array or Traversable. Sounds neat… if you love definitions. The community? Less impressed. The top reply came in hot with “Why?”, saying the piece fails to explain what problem this actually solves. Then the zinger: the author’s “don’t do this” example is literally the modern “first-class callables” syntax—yep, the thing that’s supposed to be the fix—so readers called foul and asked for clarity. Cue memes like “Stop pseudo-types? Stop PHP?” and jokes that the real plot twist is exit() becoming a normal function. The fight turned into semantics vs. pragmatism: some cheered, “Use direct callbacks and real union types, keep it clean,” while others begged, “Show real-world wins, not vocabulary lessons.” The vibe: less lecture, more why this helps my code today. Verdict from the comments? Explain it, don’t just declare it.
Key Points
- •PHP introduced the callable pseudo-type in 5.4 and the iterable pseudo-type in 7.1 via RFCs.
- •Callable represents a union of Closure, string, and array with runtime logic to verify actual callability.
- •Some constructs (isset, empty, echo, include) are not callable; exit() and die() became callable in PHP 8.4.
- •Callable cannot be used for typed properties according to the Typed Properties 2.0 RFC.
- •Iterable became a formal union type Traversable|array in PHP 8.2, losing its pseudo-type status.