News for hackers. Stuff that matters.

Ask HN: Writing better PHP

Hey guys, over the course of my membership at HN, I have seen numerous posts and discussions on writing slick and efficient JS, Ruby, Python, etc. I have not seen the same of PHP.

I know PHP is unfashionable, but I love to see a list of core texts and resources on writing better PHP. Any obvious links/books?

( 5 comments | 7 points | on HN )
Re:Ask HN: Writing better PHP by jfaucett on Wednesday August 29, 2012 @05:15PM (#4451327)
I'd recommend reading Fabien Potenciers (Symfony2 Framework) code, he writes very well designed software in PHP. Here's his blog http://fabien.potencier.org/

Off the top of my head he's the only one I'd definately recommend. Robert Lemke (Flow3 Framework), writes well structured enterprise code as well, Here's his blog: http://robertlemke.de/blog/posts

Re:Ask HN: Writing better PHP by ingve on Wednesday August 29, 2012 @04:15PM (#4450846)
PHP: The Right Way [1] was well received here on HN [2] when it was announced a couple of months ago.

[1] http://www.phptherightway.com/

[2] http://news.ycombinator.com/item?id=4212568

Re:Ask HN: Writing better PHP by orangethirty on Wednesday August 29, 2012 @03:59PM (#4450744)
Design without a language in mind, but to solve a problem. PHP is just how you tell the computer how to do something. But your solution is what ends up being elegant or messy.
Re:Ask HN: Writing better PHP by tnorthcutt on Wednesday August 29, 2012 @02:57PM (#4450405)
PHP Best Practices (http://phpbestpractices.org/) might be useful. I can't personally vouch for it.
Re:Ask HN: Writing better PHP by frytaz on Wednesday August 29, 2012 @02:37PM (#4450305)
Yii framework, design patters, write unit test for your code