<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz" -->

---
title: [RFC] [Discussion] Literal Scalar Types | daily.dev
description: A PHP internals mailing list thread discussing a proposed RFC to add literal scalar types to PHP, allowing function signatures to express exact accepted values...
canonical: https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [RFC] [Discussion] Literal Scalar Types | daily.dev
og:description: A PHP internals mailing list thread discussing a proposed RFC to add literal scalar types to PHP, allowing function signatures to express exact accepted values...
og:url: https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz
og:image: https://api.daily.dev/og/posts/9lcrG8PTZ.png
og:image:alt: [RFC] [Discussion] Literal Scalar Types
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.

# [RFC] [Discussion] Literal Scalar Types

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

## Summary

A PHP internals mailing list thread discussing a proposed RFC to add literal scalar types to PHP, allowing function signatures to express exact accepted values like `0|1|2` or `"ascii"|"utf-8"`. The RFC author argues these complement enums by covering three gaps: describing existing scalar APIs without breaking callers, supporting open/extensible value sets without the overhead of a named enum, and enabling direct scalar interop (array keys, JSON, strict equality). Skeptics note backed enums already handle much of this. A community member also suggests extending the idea to numeric ranges like `-1..1` or `1..PHP_INT_MAX`, which the author acknowledges as a logical follow-up but proposes keeping as a separate RFC due to added design complexity around bounds, coercion, and open-ended ranges.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-bcl1uxgwr) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-zupx3fo7j) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Literal Scalar Types](https://daily.dev/posts/rfc-discussion-literal-scalar-types-ig40k0a5t) · 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-u06nyuqbp) · 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-9lcrg8ptz)

```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":"[RFC] [Discussion] Literal Scalar Types","url":"https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz"},"datePublished":"2026-06-15T06:14:25.591Z","dateModified":"2026-06-15T06:14:48.920Z","description":"A PHP internals mailing list thread discussing a proposed RFC to add literal scalar types to PHP, allowing function signatures to express exact accepted values...","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":"externals.io","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":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rfc-discussion-literal-scalar-types-9lcrg8ptz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[RFC] [Discussion] Literal Scalar Types"}]}
```

