1,019 karma · joined August 23, 2013
"The EU's General Court said it had annulled that decision because the Commission had not proved that Apple had broken competition rules."
Coming from a Java background into PHP, this really confused me at first, until I started to think about PHP's approach as some kind of super-agressive garbage collection: everything gets released in that reqest thread once it's completed.
It's a fundemental design choice of the language that you have to embrace if you want to use PHP (I love it now, simplifies so much), or move on to another language.
When you really have to scale, infrastructure, resources, and networks will rapidly overtake any concerns around your choice of language. You can develop crappy architectures in any language, and the inverse is true.
So I meant one thread per request at the php-fpm level, not Nginx/HTTPD level.
* Edit for spelling
Nope, read it all as I mentioned already.
You would query those first surely, before loading the DB? Regardless, I've been using Redis and Memcache for years from PHP, so mute point.
> I use multiple threads in a single request flow frequently.
So how do you track those? And for how long do they live after the parent request has been processed, or do they block the parent? Gets complicated quickly.
> It's ugly and inconsistent, takes time to memorize, and leads to errors.
Rasmus will admit the same, but he will also admit he does not care (I've seen him say this during a talk). Nobody bought your product because it had beautiful, consistent code.
> This limits you to writing basic CRUD. And so many other languages offer this.
99.9% of web apps are CRUD.
My simple point is that PHP has been "mature", in OOP terms anyway, for at least 10 years now, so the original author tying that milestone to PHP 7.4 seems weird and outdated to me.
> - No proper connection pooling with circuit breakers.
PHP has had a "shared nothing" architecture since the very beginning, that includes DB connections. It helps it to scale (think micro-services being stateless in a modern context): nothing is shared between requests, again including connections, by design.
> - No proper multithreading (that works in web environment) or parallelism in general.
I once asked Rasmus about this face-to-face, during one of his presentations, specifically his thoughts about the pThread extension (https://www.php.net/manual/en/intro.pthreads.php), and he responded that it was not required in a web context, as web servers already have threads per request so its a mute point.
> - Almost everything blocks (even `new PDO('mysql:...')` can block for whatever the execution time limit is, if there is an issue with connection or MySQL server).
Well, it depends on your code of course, but pretty hard to proceed with some code that works with a DB when the connection can't be established, so proceed with what exactly other than error handling? Seems like a strange example. And as mentioned above, no (excluding optional pThreads) support for asynchronous threads in the language, so...?
> - Most libraries are implemented in C instead of in PHP, whereas with other languages people try to avoid native code as much as possible. This means that code is not memory safe, and understanding or contributing is close to impossible.
Ok now you have just thrown away one of the main benefits of PHP. Remember, Rasmus is a C programmer, not a PHP programmer, so he wanted to leverage that HUGE library of existing C-code from his new scripting language, from the very beginning, deliberately by design.
> The reason for this is because PHP doesn't support many things that are expected in any other language.
Yes it does, via the C-extensions, see above.
> PHP C API is hard to understand, hard to use, and documentation is subpar.
Yes programming in C is hard.
> - There is no way to easily share memory between processes. You have to rely on APCu (hack), because this cannot be implemented in PHP.
Deliberate design choice, "shared nothing architecture", stateless between requests, as above.
> - Did I mention that almost anything can block? ODBC? PDO? Some 3rd party library? Even set_time_limit cannot help you here. Handling this gracefully is close to impossible.
Yes because each request is a synchronous thread, as described above above. By design.
"And later in the century, as one phase of the conflict between England and Ireland followed another, the sins of Cromwell and his army in rooting out the supporters (both Catholic and Protestant) of the Stuarts in Ireland were used regularly as a stick with which to beat the English, albeit well over 300 years later, and as further proof that the Irish have perhaps the longest memories in the world."
For some historical context, start here: https://en.wikipedia.org/wiki/Siege_of_Drogheda
And as for the conclusion:
"The growth of British power and prosperity in the eighteenth and nineteenth centuries was in great measure built on those secure foundations. Cromwell’s part in leading the great change of culture was absolutely fundamental to that."
So Cromwell helped build the foundations of the British Empire, and that's a "good thing"? I don't know where to start, consider me triggered ;-)
If you love fine books and supporting small independent publishers, LibraryThing is an amazing niche community.
My most recent example is Solaris by Stanislaw Lem, it made me realize how difficult it would be for us to communicate with, or even comprehend the motives of a sentient alien. I wrote a full review here: http://www.alphadevx.com/a/519-Review-of-Solaris-by-Stanisla...