My last memory from PHP is 8.0 and I would still call it the king of footguns. I stopped coding PHP at 5.X and then after many years came back to 8.0 which everyone said was supposed to be better, and while it was better it was not much better. It is still a language full of footguns and unexpected behavior.
(there are plenty of other things like that; the default call-by-value is also unexpected)
Also: Laravel has plenty of "magic" ie things are intercepted via runtime reflection and then rerouted into something that hopefully "does-the-right-thing". It obfuscates control flow, causes unexpected side-effects and confuses IDEs and developers alike.
Even the popular frameworks have combinations of subawesome code and silly ideas.
Just the latest example I ran into:
```
int append(string $path, string $data) /* the signature of the Filesystem facade */
/* the implementation in FilesystemAdapter: */
public function append($path, $data, $separator = PHP_EOL)
{
if ($this->fileExists($path)) {
return $this->put($path, $this->get($path).$separator.$data);
}
return $this->put($path, $data);
}
```
- It's not correct as it will add (ffs why?) a newline in between the files.
- Performance wise, this is bloody awful.
- however, you *can* specify the separator in any call as the facade interface is just documentation and is bypassed via reflection (but that confuses your IDE)
There were even some incorrect type casting specially with numbers and "numeric strings", which were fixed recently.
I use strict typing in every new piece of code I work on, which largely fixed the problem.
Laravel, while being extremely popular, isn't exactly the flagship choice for "quality code", not even Laravel claims it to be. Symfony framework gets a lot of things right, and IMO the showcase for more modern PHP.