4 ms·
To quote the classical piece on the subject ("PHP: a fractal of bad design"): There is a whole lot of action at a distance. Consider this code, taken
by V-2 11y ago
To quote the classical piece on the subject ("PHP: a fractal of bad design"):
There is a whole lot of action at a distance.
Consider this code, taken from the PHP docs somewhere.
There is a whole lot of action at a distance.
Consider this code, taken from the PHP docs somewhere:
@fopen('http://example.com/not-existing-file', 'r');
What will it do?
If PHP was compiled with --disable-url-fopen-wrapper, it won’t work.
(Docs don’t say what “won’t work” means; returns null, throws exception?)
Note that this flag was removed in PHP 5.2.5.
If allow_url_fopen is disabled in php.ini, this still won’t work.
(How? No idea.)
Because of the @, the warning about the non-existent file won’t be printed.
But it will be printed if scream.enabled is set in php.ini.
Or if scream.enabled is set manually with ini_set.
But not if the right error_reporting level isn’t set.
If it is printed, exactly where it goes depends on display_errors, again in php.ini. Or ini_set.
etc. :) (Perhaps this particular issue is obsolete now, still it's emblematic of problems underlying the language, the ones I had to encounter when I worked with PHP few years back. Talk about "easy to use")
- krapp 11y agoSome people simply cannot accept that anyone would find PHP useful... or even tolerate its existence, and employ one particular (and increasingly obsolete) rant as if it were an objective argument against someone else's opinion on the matter. And yet, it's all subjective. If you don't like PHP, don't use PHP. It's that simple.
- V-2 11y agoAnd that's precisely what I did, of course - I no longer use it. But it doesn't mean I'm prohibited to share my experience with it. I never denied it's "useful" (is it supposed to mean much? Obviously, if apps are written in it, apparently it is of use, by definition), however I'm not alone in thinking there are better alternatives and - again, based on my personal experience - the more exposure to other languages and technology stacks a PHP developer has had, the more critical they get about PHP. The rant may be getting obsolete, but the mentality persists. To quote the creator of PHP himself: "I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "Yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I’ll just restart Apache every 10 requests". And this attitude seems very common among PHP developers. It's not just about the language, it's also about the culture. And no I'm not saying other languages are surrounded with perfect cultures (like Java's "achitecture astronauts" with mammoth frameworks and overuse of design patterns).