News for hackers. Stuff that matters.
Re:Show HN: Open-source Counter-Strike-like game by treflop on Wednesday October 23, 2024 @01:43AM (#41922154)
You could have actually made this 15 years ago! As a kid I pretty much only knew PHP and Visual Basic so I made CLI servers in PHP (…lol)

You could make asynchronous servers using socket_select(), which was added in PHP 4.1.

https://www.php.net/manual/en/function.socket-select.php

There was also a third party extension that added threads to PHP 15 years ago, although it was buggy.

Re:Show HN: Open-source Counter-Strike-like game by diggan on Wednesday October 23, 2024 @08:16AM (#41924204)
> There was also a third party extension that added threads to PHP 15 years ago, although it was buggy.

Reminds me of ReactPHP (no, not that React) that allowed you to do non-blocking I/O in PHP back in like 2012-2013 sometime. Maybe that's the library you're referring to actually?

https://github.com/reactphp/reactphp

Re:Show HN: Open-source Counter-Strike-like game by treflop on Wednesday October 23, 2024 @10:36AM (#41925456)
I mean actual threads.

Seems they still have the docs up: https://www.php.net/manual/en/book.pthreads.php