European here. You're spot on with your question. Europe is an extremely hostile place to start a business compared to USA.
USA embraced capitalism and is geared towards proving concepts FAST and enabling networking. I love that about USA and I miss that in Europe, when it comes to IT/Tech sector in particular.
I'm not aware if Europe produced anything of significance in the past 30 years, we're lagging heavily behind USA/China and that's a fact. One could argue that Linus Torvalds is European hence Linux === European but I won't resort to such petty claims.
We produced very little value. We're having issues due to language discrepancy. Even though a lot of people speak English, it's often the case that we Europeans aren't able to communicate as well using English as we can in our native tongue. The lack of unified language is visible. The diversity in culture drives people to favor their own, we're bad at teamplay (this is from my personal experience and I am guilty of this).
There's many valuable lessons we could have learned from USA but we failed to apply them. We have various freely available systems that are great at, say, education - but education means nothing when it's difficult to apply it once people are done with it.
I worked with plenty of people from USA and I had huge prejudices towards them, in terms of "they talk a lot" or "they are not as competent, they are really slow when it comes to pumping out code" but I learned I was wrong to the point it's not funny. If anything, USA is really good at starting and pushing projects out that actually work.
Ultimately, do we even have a microchip factory (we might, but I'm unaware of it)?
Sorry for the wall of text, I just wanted to explain my POV and agree with you.
Personally, I'd love to see movement in EU's tech sector. We're 30 years behind USA in tech. I won't touch upon quality of life or similar topics because I'm interested in exploring technology.
It's obvious you have no idea what ZTS build of PHP does and you're just spewing nonsense at this point.
Creating a few thousand "new object" takes less than 5 msec. Test it. I have.
FrankenPHP uses a Go-based balancer that distributes requests to array of pre-started workers. Just like PHP-FPM does.
If you already used PHP's parallel extension, then you should at least know the difference between thread and process instead of typing buzzwords, thinking it makes you look cool if you use them :)
It doesn't even depend. The underlying engine that executes opcodes is the same. Minimal speedup from not having to execute several "new objectname" commands isn't even a drop in the sea when it comes to what servers do.
I, for one, would love to be wrong about this and that FrankenPHP with all the other alternative runtimes actually brought benefits.
There are claims this is faster. It's not. I used it, together with other "alternative" runtimes which are just PHP command line interface long running scripts with some sort of task distribution balancer in front. Just like PHP-FPM is.
The apparent speedup comes from the fact it's not shared-nothing, meaning that objects from previous requests (and variables) are persisted and present in subsequent requests. This makes it work exactly like Node.js, removing the wonderful part of PHP which is that it automatically cleans up all the crap devs created and creates clean slate when next request is to be executed.
All of these "alternative" runtimes are false positives, because they're quick for first few requests but get slower and slower for the subsequent ones. Then, the workers are killed and restarted (precisely what PHP-FPM does too).
Since there's no new engine behind executing PHP, the only way FrankenPHP (and others) can yield any performance is when they're benchmarked against misconfigured PHP-FPM (opcache off, JIT off, persistent connections off).
It's not my cup of tea. I like that there are attempts at doing <something> but turning PHP execution model into Node.js execution model isn't the way to go.
I find it cheaper to throw a few bucks at stronger hardware compared to risking accurate execution to become flaky because shared-nothing is now unavailable.
Function has 3 arguments. It's documented. Use cases are documented. You are trained. You ask for.. even more protection? From what? There's a limit to laziness, it takes more time to do this word-warrioring on HN than to learn how to use the function correctly and how to create a wrapper around it that serves as the protection you seek.
This really isn't that hard, we're not trying to travel to Mars.
Check this - if it's something important.. don't forget it and implement something called "function" that would pass the third parameter by default?
Anyone who is not capable of taking care of what you called footgun in a way where they automate - that person is not serious.
If there's a pretty huge problem - manage it. That's your job as programmer. If you're lazy, sloppy and prefer whining online over being proud of your work - there's no programming language that will take care of that for you.
No, it's not a function that causes it. It's the dev who is sloppy and causes issues. Would you blame the scalpel or brain surgeon for mishap while cutting important bits in the brain?
What kind of logic is this, to blame the tool because you have no clue how to use it?
The problem is that you're trying to use PHP as if it's a different language.
If I have to deal with files, I'll create a class and I'll combine functions file_exists, is_file, is_writable, file_get_contents, file_put_contents (and new fsync) in conjunction with stream_context_create. I can even get the errors that OS spits out and test for what exactly went wrong, but you obviously ignored that and gave up. I can tell you used the language sporadically, not professionally.
You're taking a small, localized issue that arose, while your job as programmer is to get around idiosyncrasies in programming languages with the focus on achieving the end goal.
I've a list of terrible things that PHP does but I have one for JS/TypeScript/Go/Rust/<you name it>.
My job is to know these and achieve goals, not to criticize languages because file handling in it is not the same as in C++ and language didn't fire up 50 AWS instances to spam X.com with messages in hopes that I somehow notice them.
But I didn't forget the third strict parameter, because I'm diligent in reading documentation and at my job.
Was that everything? You basically state there's a problem because you didn't use the function correctly and language didn't fall head over heels to stop you from doing silly things due to slopiness?
I'm one of those who used Internet Explorer 5.0 and was there to complain about Internet Explorer in general. I'm not sure why you are amazed with Chrome transition, but let me give insights from experience.
We had Firefox 0.3 which was very, very slow browser but still much better than Internet Explorer. There was a lot of mental gymnastics involved to get pages display at least similar for both browsers.
When Chrome 1 was released, it was absolutely awesome. Minimal interface. Focused on browsing. Incredibly fast, it just executed JS stupidly quick and we could create web app interfaces that didn't lag
You can still download Chrome 1 and see what it's about. It was basically what users wanted: supports more CSS features than other browsers, starts fast, executes JS fast, provides adequate developer console, renders pages correctly.
It took all of us by storm because it was genuinely good software. That era was the era of good software, not spam advertising.
Today, in 2023. this is not true any more and you are entirely correct when asking why people would use Chrome. Answer is: laziness, lack of info, apathy, lack of knowledge.
It doesn't mention any dependency on JS, there's pseudocode in Python to demonstrate generating/using the token.
> but some web apps use JS and sessionStorage on browser to store session token instead of using cookie
This is particularly strange, I've seen that frontend apps do this but I can't understand why because it's error prone and excellent attack vector. It boils down to emulating cookies, having to have some sort of request interceptor that includes the token on every XHR/fetch to serverside and another interceptor that saves updated token on every valid response from serverside. It seems like a misguided attempt to rectify problems that stem from CORS handling or shortsighted design where auth was bolted on as an afterthought.
USA embraced capitalism and is geared towards proving concepts FAST and enabling networking. I love that about USA and I miss that in Europe, when it comes to IT/Tech sector in particular.
I'm not aware if Europe produced anything of significance in the past 30 years, we're lagging heavily behind USA/China and that's a fact. One could argue that Linus Torvalds is European hence Linux === European but I won't resort to such petty claims.
We produced very little value. We're having issues due to language discrepancy. Even though a lot of people speak English, it's often the case that we Europeans aren't able to communicate as well using English as we can in our native tongue. The lack of unified language is visible. The diversity in culture drives people to favor their own, we're bad at teamplay (this is from my personal experience and I am guilty of this).
There's many valuable lessons we could have learned from USA but we failed to apply them. We have various freely available systems that are great at, say, education - but education means nothing when it's difficult to apply it once people are done with it.
I worked with plenty of people from USA and I had huge prejudices towards them, in terms of "they talk a lot" or "they are not as competent, they are really slow when it comes to pumping out code" but I learned I was wrong to the point it's not funny. If anything, USA is really good at starting and pushing projects out that actually work.
Ultimately, do we even have a microchip factory (we might, but I'm unaware of it)?
Sorry for the wall of text, I just wanted to explain my POV and agree with you.
Personally, I'd love to see movement in EU's tech sector. We're 30 years behind USA in tech. I won't touch upon quality of life or similar topics because I'm interested in exploring technology.