Live data from Hacker News

The new PHP

programming.oreilly.com

151–160 of 203 posts

Re: The new PHP

#151
What I don't comprehend is how someone can know of all this and then still stay "you know what? fuck namespaces and PSR, we are doing it old school!" and come up with arguments like "I/O overhead is costly in one class per file scenarios"[0].

These people will be the death of all of us.

[0] https://www.sellvana.com/blog/on-composer-psr-and-namespaces

Re: The new PHP

#153

> generators for simpler iteration, namespaces, and variadic functions and argument unpacking. With PHP 5.4, traits were introduced (a la Scala or Perl) to allow code reuse in single inheritance languages, as well as closures, which allow you to code PHP in a functional style. "The new Java" It's good to see PHP maturing. However sometimes the most important features of a language are the features you don't add. I th…

they should introduce a robust "clean" api in PHP6 and remove the old stuff in PHP7. that will let sometime to rewrite libs.They should move to C++ too,it's a pain to OO write extensions in C.

Re: The new PHP

#154

Whenever I hear "the new PHP" or "its not the old mess anymore", I say to myself, thats hardly the point. The key flaw I find with PHP is with its community and lack of any mature frameworks. Half of the PHP coders are hopeless script kiddies, thanks to low barrier entry it has, and I don't feel a single framework exists that can match Rails or Django. For the matter of fact, the framework with largest community, Cod…

There's a vast array of frameworks for just about any appetite available in PHP. Just looking for a simple MVC app? Silex ( http://silex.sensiolabs.org/ ) Want something that's beefier and more rails-inspired? Laravel ( http://laravel.com/ ) Want MVC but near native PHP performance? PhalconPHP ( http://phalconphp.com/en/ ) Building an enterprise application with a team of developers? Symfony ( http://symfony.com/ ),…

You mention performance... Is phps performance any good? I've always been under the impression that it is quite slow. Maybe I'm just buying the fud.

Re: The new PHP

#155
post #87
post #69

Earlier quoted context omitted.

> Unless the web server displays a huge red message every time it is run Uhh... this is the first line the web server spits out: PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011 The manual isn't exactly vague on this point either: http://us3.php.net/manual/en/features.commandline.webserver.... So we got the warning already in there, what else would you like?

20 words of that manual were dedicated to letting people know its not for use in production. Un-highlighted and buried at the end of a paragraph that I initially skimmed over and didn't even read. No attention is directed at it in any way. So the server outputs a message. Great. Is it huge, red and says "do not use me in production"? No. Its a standard version banner.

Fair point. This is how that page will look after the weekly manual rebuild occurs on Friday: http://i.imgur.com/YXhafB5.png

Re: The new PHP

#156

It really pains me that there are so many utter misunderstandings about modern PHP from people that used it years ago and have no clue about the current landscape, even in this thread. Yes, the PHP core api is still a bit messy due to backward compatibility, but everything else it pretty awesome really. Please take a closer look if you haven't touched PHP in years, before you talk it down.

Oh, did you mean PHP the language? The webserver? The FastCGI server? The runtime?

PHP starts as a fucking mess and gets worse. Maybe once the developers figure out what it is I'll take a look but yeah it's pretty much the developers taking standard features from other languages and fucking them up just like they did yesteryear.

Closures with a use block... even in C you don't have to do that... it's a joke and a mess... How is it that a 44 year old language has better features and less cruft than one 15 years old?

Does it have a ==== operator yet?

Re: The new PHP

#157
post #87
post #69

Earlier quoted context omitted.

> Unless the web server displays a huge red message every time it is run Uhh... this is the first line the web server spits out: PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011 The manual isn't exactly vague on this point either: http://us3.php.net/manual/en/features.commandline.webserver.... So we got the warning already in there, what else would you like?

20 words of that manual were dedicated to letting people know its not for use in production. Un-highlighted and buried at the end of a paragraph that I initially skimmed over and didn't even read. No attention is directed at it in any way. So the server outputs a message. Great. Is it huge, red and says "do not use me in production"? No. Its a standard version banner.

I am of the opinion that it's simpler to write a basic PHP file than it is to configure Apache, Nginx, Lighttpd. I'd think that the majority of people running WordPress (likely the most distributed PHP project) are doing so on shared hosting, and not likely to want to or know how to configure their own server. The type of person interested in the built-in web server (a decent feature in my opinion, and comparable to `rails s`) is knowledgeable enough to know that the built-in web-server will not cut it for production traffic.

Re: The new PHP

#158
post #154

Earlier quoted context omitted.

There's a vast array of frameworks for just about any appetite available in PHP. Just looking for a simple MVC app? Silex ( http://silex.sensiolabs.org/ ) Want something that's beefier and more rails-inspired? Laravel ( http://laravel.com/ ) Want MVC but near native PHP performance? PhalconPHP ( http://phalconphp.com/en/ ) Building an enterprise application with a team of developers? Symfony ( http://symfony.com/ ),…

You mention performance... Is phps performance any good? I've always been under the impression that it is quite slow. Maybe I'm just buying the fud.

Performance isn't bad. You've been able to install an opcode cache for years, and there's one built into the runtime now. HHVM really boosts performance, and it's closing in on full compatibility with mainstream PHP.

Re: The new PHP

#159
post #123
post #107

Earlier quoted context omitted.

Sorry, but this is mostly wrong. PHP has two awesome frameworks - Symfony and Laravel. They both have their pro's and con's, but both are very mature frameworks that can both match Rails or Django in their own rights. Both of fully tested, both have full auth libraries. CodeIgniter does not have the largest community by any stretch, and its falling fast. If it hasn't already died, then it will in the near future. Sor…

PHP has at least two awesome frameworks. CakePHP, Phalcon, and ZF2 are all very awesome in their own ways.

Phalcon is, in my opinion, the best thing to happen to PHP in years.

Re: The new PHP

#160
post #58
post #5

Earlier quoted context omitted.

The web server is explicitly for development purposes. It is not meant for production. > It strikes me that adding more tools that incompetent web developers can abuse is what got them there in the first place. This is profoundly ridiculous. It's the equivalent of saying Home Depot shouldn't sell power tools because some do-it-yourselfer might saw his foot off. Just because a tool can be misused is not an argument ag…

> This is profoundly ridiculous. It's the equivalent of saying Home Depot shouldn't sell power tools because some do-it-yourselfer might saw his foot off. You're incorrectly characterizing the argument: it's actually like saying Home Depot shouldn't sell power tools without safety guards, fuses, emergency shutoffs, SawStop, etc. PHP has a number of misfeatures which make it extremely easy for all but the most vigilan…

Here's all you really need to know with PHP, ask a PHP developer how to test for equality.

Maybe how you test for equality shouldn't depend on an ini file... just sayin...

Perhaps testing for equality doesn't need a 3 page answer... in most languages it's a pretty straightforward answer... primitive types use == and objects use either isEquals or operator overloading.

Post reply on HN