Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A cool. I knew there was some type of thread support. I figured most PHP devs would be more comfortable with the short running "page" concept rather than diving into threads and long-running stateful apps.

Anyway, I feel the same way about PHP. It's simple and easy and if you use it for the right job then it just works great. I think a lot of the hate is based on old, sloppy PHP code. Modern PHP apps are organized and use frameworks that don't look radically different from more popular languages.



The problem with things like pthreads in PHP is that 98% of the time your runtime is via mod_php5, and spinning threads off of an Apache worker instance is one of the worst ideas imaginable.

I (once, ignorantly) tried to do some kind of super lightweight background-like worker with pthreads in PHP instead of bringing in a full queue and worker design and it turned out that there is absolutely 0 capability of doing it with the slightest hint of sanity. Having libraries like that is cool, but it's not for what PHP was designed for: web pages. Arguably and controversially, web applications are even a stretch for the language, but the support is and has been getting better with actual classes, namespaces, and tooling support like Composer and agreed-upon libraries like Doctrine. Then again, I just fled a company who's entire infrastructure was dependent on cronjobs running tasks using relational databases as queuing mechanisms with very little use of ORMs. It doesn't really matter if the language gets better, because the bar isn't really getting raised, unfortunately. After making the language more desirable (which has been done), a community effort needs to be made to shame and call out bad code, which might end up requiring a jump to 6.0 finally and breaking backwards compatibility with everything that's changed since 4.x (mysql_escape_string, mysql_x instead of mysqli_x or PDO, etc.) At least non-parseable code isn't going to fester bad practices.


> 98% of the time your runtime is via mod_php5

Not true anymore, a lot of code is running in php-fpm nowadays.


yea that is kinda what I was thinking as far as why native GUI widgets wouldn't be a good idea - because that leads down the path of long-running stateful UI process which I think is very un-PHP in lots of ways!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: