[Writing](/blog/)

# Introducing TypeID PHP

Type-Safe, Sortable Identifiers for Modern Applications

By [Jewei Mak](/about/) · April 26, 2025 · 1 min read · Updated May 31, 2026

-   [Open Source](/blog/open-source/)

> Update (May 2026): v1.1 has been released! The minimum supported PHP version is now 8.4, and all tests fully pass against the official specification.

TypeID PHP brings type-safe, globally unique identifiers to your PHP projects. This library implements TypeIDs - an elegant extension of UUIDv7 that adds descriptive type prefixes to identifiers.

Instead of working with opaque UUIDs like _01890a5d-ac96-774b-bcce-b302099a8057_, you get human-readable IDs like _user\_01h455vb4pex5vsknk084sn02q_ that instantly communicate their purpose.

## Why Use TypeID?

-   Type Safety: Prevent errors by distinguishing between different entity types
-   Intuitive Debugging: Immediately identify what an ID represents
-   Database Performance: K-sortable for better index locality
-   Space Efficiency: URL-safe base32 encoding (26 characters vs 36 for UUIDs)

## Quick Example

```php
// Generate a user ID
$userId = TypeID::generate('user');
// user_01h455vb4pex5vsknk084sn02q

// Create a product ID from an existing UUID
$productId = TypeID::fromUuid('product', $uuid);
```

TypeID PHP integrates seamlessly with existing systems while enhancing readability and safety. Install today with _`composer require jewei/typeid-php`_ and bring more clarity to your identifiers.

 [![TypeID PHP (TypeID logo thumbnail)](/_astro/typeid-php-thumb.CSGOxitn_Z2fsxUx.webp)](https://github.com/jewei/typeid-php)

PHP implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs

Writing takes time. If this post helped, [sponsor my work](https://github.com/sponsors/jewei).

## Continue reading

[All writing](/blog/)

1.  [Bopop: press, type, go](/bopop-press-type-go/) — Jul 20, 2026. I built Bopop, a keyboard-first launcher for macOS. Local-first, no Accessibility permission, zero dependencies. Free and open source.
2.  [Uppa: A Small Uptime Monitor at the Edge](/uppa/) — Aug 20, 2026. A self-hosted uptime monitor and public status page built for Cloudflare Workers.
3.  [Laravel Skeleton](/laravel-skeleton/) — Aug 13, 2023. The Laravel Skeleton offers a rapid and efficient way to start a new project by scaffolding a Laravel app with minimal setup.

**Previous:** [The Spectrum of Software Makers](/the-spectrum-of-software-makers/)

**Next:** [The Eight Levels of AI Adoption](/the-eight-levels-of-ai-adoption/)
