# A 174-line PHP shim I wrote in 2014 as a temporary fix now has nearly 20 million installs. Today I'm deprecating it.

Original title: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

> Hacker News story 49718773 · language: en · submitted 2026-09-15
> Web version: https://zeli.app/story/49718773
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 337 · by [jakeasmith](<https://news.ycombinator.com/user?id=jakeasmith>) · 💬 104
[original](<https://jakeasmith.com/blog/http-build-url/>) · [HN discussion](<https://news.ycombinator.com/item?id=49718773>)

## Summary

In 2014, I wrote a 174-line PHP polyfill for http_build_url() as a stopgap during AOL's CMS upgrade. It was installed nearly 20 million times and still gets over 400,000 monthly installs, bundled in WPML, Debian, and Ubuntu. After discovering a bug that strips every 'a' from paths with trailing slashes, I'm deprecating it rather than handing it to a new maintainer, to avoid supply-chain risks. The README explains how to switch to The League's URI library or PHP 8.5's built-in URI API.

## Key quote

> I wrote this code to ease a painful migration, for myself and anyone else going through the same one. Thank you to everyone who sent a pull request or offered to take it over, and to the people who kept filing issues long after I’d stopped reading them. It was a good run for a temporary fix.

## HN discussion (104 comments)

### [Sander_Marechal](<https://news.ycombinator.com/item?id=49737297>)

> There is nothing as permanent as a temporary fix that works.

### [jakeasmith](<https://news.ycombinator.com/item?id=49718838>)

> Author here, happy to answer any questions. I never imagined a polyfill for http_build_url would gain so much traction. After 12 years, deprecating it feels like the right move, especially given the new options from the community and PHP itself.

### [swiftcoder](<https://news.ycombinator.com/item?id=49742385>)

> \>  Under a comment that reads // Workaround for trailing slashes, my code tacks an “a” onto the path so there’s always a last segment to cut off, then cuts it off with a find-and-replace. When the path ends in a slash, that last segment is just the “a”, and the find-and-replace takes every other “a” in the path with it.
>
> This is top-tier. left-pad levels of "we should just implement trivial functions in our own codebases"
>
> (I do not mean that as a knock on the author - it solved his use case just fine. Everyone who took a dependency on it afterward though...)

### [amhoab](<https://news.ycombinator.com/item?id=49737159>)

> We used to work together at AOL. Glad to see you on here; I hope you're doing great!

### [zackmorris](<https://news.ycombinator.com/item?id=49742911>)

> PHP did extensions and PECL modules wrong, due to its roots as a web server language. With managed hosting, often PHP doesn't offer what we might think of as basic functionality, since the admin didn't install/enable it. So it makes sense that these little one-off packages exist to route around snafus.
>
> It's still my favorite language though, since it comes closest to shell language but with C-style syntax (other than maybe Perl, which is a write-only language and hard to read, which unfortunately inspired Ruby to inherit some anti-patterns).
>
> I often dream about writing a modern hacker language that combines the best of everything like functional programming, higher-order methods, const by default, parallelism, sync blocking rather than async nonblocking concurrency, etc. It would also undo the pass-by-reference footguns added by PHP 5+ and return to the pass-by-value copy-on-write style of arrays. That's why I really can't endorse attempts like Hack which just introduce a new standard with its own problems.
>
> The insight being that LLMs work around the limitations of mainstream languages and frameworks, rather than challenging assumptions from first principles and building better foundations.

### [laruss5](<https://news.ycombinator.com/item?id=49737520>)

> For a package with that kind of install base, is there a final release that prints the migration options in a deprecation notice? People will find it years from now through old Stack Overflow answers.

### [AltruisticGapHN](<https://news.ycombinator.com/item?id=49738236>)

> Should the repo be archived?
>
> I rarely see people use that feature yet tons of repos on Github are essentially dead.

### [hk__2](<https://news.ycombinator.com/item?id=49740088>)

> \> Along with the numbers, there were a handful of GitHub issues, including one where joining a path onto a URL with a trailing slash strips every letter “a” out of the path.

---

## Cite

- Page: https://zeli.app/story/49718773
- Date: 2026-09-15
- Source: jakeasmith.com (https://jakeasmith.com/blog/http-build-url/)
- Hacker News: https://news.ycombinator.com/item?id=49718773

## Other languages

- zh: https://zeli.app/zh/story/49718773 · markdown: https://zeli.app/zh/story/49718773.md
- ja: https://zeli.app/ja/story/49718773 · markdown: https://zeli.app/ja/story/49718773.md
- ko: https://zeli.app/ko/story/49718773 · markdown: https://zeli.app/ko/story/49718773.md
- de: https://zeli.app/de/story/49718773 · markdown: https://zeli.app/de/story/49718773.md
- es: https://zeli.app/es/story/49718773 · markdown: https://zeli.app/es/story/49718773.md
- ru: https://zeli.app/ru/story/49718773 · markdown: https://zeli.app/ru/story/49718773.md
