Live data from Hacker News

PHP's Oddities

flowtwo.io

181–186 of 186 posts

Re: PHP's Oddities

#181
post #168
post #166

Earlier quoted context omitted.

It’s not so irrelevant if your org is stuck on older versions of PHP.

Being stuck on versions of PHP published >= 8 years ago isn't a valid excuse anymore, with AI and static analysis tools available IMHO. And even if you really don't identify using CVE-ridden, unsupported, ancient software to handle customer data as a critical business risk and insist on riding the burning train instead - well, then you've lost all right to poke fun at the legacy PHP versions you're stuck on, because…

I like this guy

Re: PHP's Oddities

#182
post #131
post #80

Earlier quoted context omitted.

> What is inaccurate about it? It's been debunked so many times over the years, I'm afraid I don't have the energy or desire to do it again when it's really not needed if you're far out of the php ecosystem that it really won't make a difference. Suffice to say the PHP it is talking about is nothing at all like modern PHP.

Sure PHP has improved since that was written, but I'm pretty sure it was accurate when it was written. And I suspect that it was probably a contributing factor in some of PHP's improvements since then.

It was accurate when it was written, but within a couple of years of that it wasn't yet it was still constantly used. Thats where it became damaging, people not grasping how inaccurate it was yet still kept pushing it as a current understanding of the language.

Re: PHP's Oddities

#183
post #174

Earlier quoted context omitted.

When a php file is loaded at runtime, it runs through a very basic JIT compiler that does statically check a few things before continuing with execution. Syntax, for example, is checked for the entire file during this step. Most type checking happens at runtime (this might not be true for interfaces at some level, but I can’t say for 100% certain - I just know I tend to see interface related errors earlier during cod…

Is there a way to run type checking ahead of time similat to typescript or python's mypy or pyright?

PHPStan is one of the more popular tools to evaluate that stuff. It works by examining each file and resolving all of the imports to verify that all of the types are compatible.

Jetbrains PHPStorm has this sort of type resolution built in (one of their value adds) but you can also run PHPStan instead of their proprietary version.

Re: PHP's Oddities

#185

Earlier quoted context omitted.

PHP arrays are vectors, hash maps and doubly linked lists in one

My issue is a ton of people call all maps a hash regardless how it's implemented.

With good abstraction the implementation can be swapped without many noticing.

However PHP leaks different aspects hear and there, making this harder ...

Re: PHP's Oddities

#186

I have not seen "PHP" listed as a language used in any Hacker News job posting in a very long time. Everything is Javascript/Typescript now, with the occasional Rust, C/C++, Golang, Python, Ruby. I never see PHP ever.

You must not be looking very hard because there's literally six PHP jobs on May's "Who's Hiring" list: https://hnhiring.com/technologies/php

I count 5 based on that link. And only 2 are in USA, so my apologies, should have said "PHP + allowed to work in USA (remote/hybrid/onsite)". two is greater than zero, so hurray I guess...
Post reply on HN