---
title: "[RFC] [Discussion] Literal Scalar Types"
url: https://daily.dev/posts/rfc-discussion-literal-scalar-types-eorguy6a7
source_url: https://externals.io/message/131255
type: article
source: "externals.io"
published: 2026-06-15T04:57:56.206Z
updated: 2026-06-15T04:58:16.514Z
tags: ["php"]
reading_time: 7
upvotes: 0
comments: 0
language: 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.

# [RFC] [Discussion] Literal Scalar Types

**[externals.io](https://daily.dev/sources/externals)** · 7 min read · 0 upvotes · 0 comments

## Summary

A PHP internals mailing list thread discussing a new RFC proposing literal scalar types for PHP. The RFC would allow type signatures like `0|1|2` or `"ascii"|"utf-8"` as actual type constraints. The author argues literal unions fill gaps enums cannot: they can describe existing scalar APIs without breaking callers, support open value sets that grow without BC breaks, and work natively as scalars (array keys, JSON, strict equality) unlike enum objects. A skeptic counters that enums already cover most use cases, with backed enums handling scalar interop. A third participant expresses tentative support for the simplicity the feature offers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131255>

## Similar posts on daily.dev

- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-z29tjsqvl) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-9myhaejd7) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-bcl1uxgwr) · externals.io · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-discussion-literal-scalar-types-eorguy6a7)
