Live data from Hacker News

The new PHP

programming.oreilly.com

121–130 of 203 posts

Re: The new PHP

#121
post #53

All this is very true. Modern PHP is not the PHP of yesteryear. With Composer for dependancy management and sticking to the PSR's you can build very stable, testable, and modern applications that change minds about PHP.

The thing is you have to be a medium-to-expert to be confident about Composer dependencies, every new dev is going to use the language API, which resembles a bunch of functions with no general pattern. PHP users need to keep it together and set a common base, a standard library with sane defaults.

I am new to PHP and I started right off with composer -- all you have to do is composer require pkg dev-master [or other pin].

I don't see how this is different from gem install pkg.

Re: The new PHP

#123
post #107

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…

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.

Re: The new PHP

#124
post #74
post #2

> It contains powerful new features and helpful developer tools, such as a built-in web server I haven't finished the article yet, but really? Is that what PHP needs? A built-in web server? It strikes me that adding more tools that incompetent web developers can abuse is what got them there in the first place. How long until we start having security releases for the PHP web server, because so many clueless devs decid…

Considering the fact that I can set up a development environment in docker using PHP with a makefile and it's built in webserver, I'd say you've missed the point of it. It's a great addition, and with Composer/Packagist (which does currently have an issue with replacement packages, that needs to be fixed) plus the new features in 5.5, I can comfortably say I like using PHP. Also, I've really got to stop reading the c…

you mean where anyone can submit a package, and it's replacements will be taken into consideration globally?

Replace everyone's symfony security/auth module? what could possibly go wrong? :D

Re: The new PHP

#125
post #111
post #35

Earlier quoted context omitted.

PHP has a rather strict no-BC-break policy for minor releases. As such the 5.x series improves the language mostly through additions. I think that's good. PHP has been missing a number of things that are now present. However that doesn't work forever, at some point you need to clean up some of the old stuff. That's why a PHP 6 release is planned in the near future (i.e. somewhere in the next three years ^^).

The very first programming book I bought was "PHP6 and MySQL5" by Larry Ullman. I bought that one specifically because I had another job (career, really) and I knew it was going to take a while before I really got into programming and I didn't want to buy a book that was going to be out of date in 2 years. That book is now 6 years old, out of date, and PHP6 is still not released. Maybe 6 is just an unlucky number wit…

Literally bought the same book by Larry Ulman.

Re: The new PHP

#126

Earlier quoted context omitted.

Codeigniter has been all but abandoned by EllisLab, the community is giving up on it and there are far better frameworks available now. For example Laravel, the growth that Laravel is experiencing right now is huge, it has overtaken Codeigniter as the most popular PHP framework on GitHub and has a growing and active community. Anyone even thinking about Codeigniter any more is doing themselves a disservice, Laravel i…

I recommend FuelPHP [1] - it has amazing documentation, a lot of built-in libraries, takes advantage of PHP5 features, is quite mature and really easy to dive in. [1] http://fuelphp.com/

+1 for FuelPHP - well thought out and easily extensible.

Re: The new PHP

#127

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…

I agree on the point of frameworks. I don't like any that exist so I made my own Rails-inspired one. Unfortunately this means I prefer not to do consulting jobs in PHP because it's considered bad practice to use a framework that no one else knows. (Mine has dynamic ORM (reads db schema), a console (REPL that loads project config and autoloader file), and similar project layout. Recently added REST API system that gen…

> I agree on the point of frameworks. I don't like any that exist so I made my own Rails-inspired one.

Thats a joke right ? RIGHT ? PHP probably has one of the best, most mature and versatile selection of frameworks there is.

Re: The new PHP

#128
post #120

Here's what would make me accept PHP as passable practical web programming language: A good REPL, with good support for it over all frameworks. That's all it would take. Given that it doesn't have one, python beats it easily.

You mean like boris? https://github.com/d11wtq/boris

Looks good, but here's the practical question: Can I enter this REPL with all the libraries and models of my web framework loaded so that I can query a model through it, modify the object and save?

Re: The new PHP

#129
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.

Re: The new PHP

#130
post #128

Earlier quoted context omitted.

You mean like boris? https://github.com/d11wtq/boris

Looks good, but here's the practical question: Can I enter this REPL with all the libraries and models of my web framework loaded so that I can query a model through it, modify the object and save?

No more than you could with any other execution environment. Autoloaders should find your libraries if you are using the same entry point, and you can query a model as you could in any other language. It looks like people have made something like this for CakePHP: http://josediazgonzalez.com/2013/12/04/interactive-command-l...

And there are some REPLs with tab completion: https://github.com/ErikDubbelboer/php-repl

Post reply on HN