Hacker news

  • Top
  • New
  • Past
  • Ask
  • Show
  • Jobs

My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it (https://jakeasmith.com)

339 points by jakeasmith 4 days ago | 106 comments | View on ycombinator

Sander_Marechal 3 days ago |

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

jakeasmith 4 days ago |

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 3 days ago |

> 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 3 days ago |

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

laruss5 3 days ago |

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.

zackmorris 3 days ago |

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.

AltruisticGapHN 3 days ago |

Should the repo be archived?

I rarely see people use that feature yet tons of repos on Github are essentially dead.

hk__2 3 days ago |

> 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.

edg5000 3 days ago |

Crazy that the bug went unnoticed. So many sites must have been broken by the "a" bug.

bdcravens 3 days ago |

In 2009, I started a project, was given a CSV, and in testing the import I created a quick table called "{businessDomain}Temp". Yes, that table is still there, still has the same name, and is load bearing (not in the LLM meme sense, but the business depends on it). Yes, I'm been promising myself I'll fix it one day for just as long.

staplung 3 days ago |

By Hyrum's Law and the fact that there are 20M installs, we can infer that somewhere, some nitwit is probably using this bug as a handy function for removing 'a's from a string.

https://www.hyrumslaw.com/

https://xkcd.com/1172/

alpha_trion 3 days ago |

12 years is a pretty good run for a temporary fix!

tcdent 3 days ago |

I don't think I quite valued the Open Source PHP ecosystem at the time as much as I should have. I have a project that still grabs a ton of installs for some reason (3+ million to date and apparently growing) which is way beyond anything I would have expected.

https://packagist.org/packages/tcdent/php-restclient/stats

algoth1 3 days ago |

Are you from Nebraska?

samayashar 3 days ago |

Thanks for pointing this out. I used PHP for one of my professional projects and never came through this - maybe because the library was not a part of our codebase.

This article will be very useful for people who might shift back to older PHP versions for compatibility and face it.

Codefrontier 3 days ago |

Love you kept it alive this long

crumb1e 3 days ago |

Reading this made me really nostalgic. I cut my teeth in web/software dev in the Laravel 5.x days, and it's quite jarring comparing the day-to-day we have now with back then!

undefined 3 days ago |

undefined

KellyCriterion 3 days ago |

Curious: How big is the risk that abandoned extension/fixes turn into a security problem soon in these AI days?

racl101 3 days ago |

I love these kinds of stories.

ivo93 3 days ago |

[flagged]

iliasaberkane 3 days ago |

[dead]

yaniv_codpal 3 days ago |

[flagged]

ethanprk 3 days ago |

[flagged]

j4kp07 3 days ago |

[dead]

shevy-java 3 days ago |

[flagged]

gitowiec 3 days ago |

Omg, PHP... I ditched this language 7 years ago, because I was fed up with the context switching (fullstack webdev). In the beginning I really was enjoying the gentle slope of learning. I could do a lot without knowing what classes, objects and types are. And I am grateful for this, because thanks to it, now I am here where I can do much more powerful things knowing classes, objects, types and paradigms