按年被提到
20122013 · 12 次2026
开源书›编程语言·No.30

PHP: The Right Way

PHP 正道
Josh Lockhart, Phil Sturgeon 等

现代 PHP 最佳实践速查,纠正过时的写法

免费阅读 ↗
被推荐 · 68 人首次 2012-07-07 · 最近 2026-03-07许可证 CC BY-NC-SA 3.0
68不同的人
53活跃月份
32有推荐的月份
66讨论串

由 Josh Lockhart、Phil Sturgeon 等人维护的社区指南,汇总现代 PHP 开发的惯例和最佳实践,如代码风格、依赖管理、安全、测试和部署,并附上进一步阅读的链接。它不是循序渐进的教程,而是一份集中在一个站点上的清单式指南。目标是让新手少走弯路,纠正网上大量过时的 PHP 教程。

HN 为什么推荐它

HN 上的人反复把它推给 PHP 新手,用来抵消过时的教程和坏习惯,说它覆盖现代 PHP 的基础又不堆砌清单,是入门时的好起点。

难度 2 / 5约 8 小时开放许可
适合谁

刚入门或回归 PHP 的开发者

读之前最好知道
1PHP 基础语法

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1先通读一遍,知道现代 PHP 有哪些惯例
  2. 2遇到具体问题时回来查对应章节
  3. 3顺着它给的链接深入读 Composer、安全等主题
  4. 4和官方文档配合使用

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
推荐grakic · 2012-07

“PHP The Right Way is better on this: PHP”

推荐它作为 PHP 日期时间处理的更好参考
PHP Tips and Tricks - Codular原评论 ↗
推荐ingve · 2012-08

“PHP: The Right Way [1] was well received here on HN [2] when it was announced a couple of months ago.”

提到它发布时在 HN 反响不错,是写好 PHP 的指南
Ask HN: Writing better PHP原评论 ↗
推荐throwawayG9 · 2013-04

“I'll leave these links here, you might find them useful:”

贴出它作为现代 PHP 开发的参考
URLs are for People, not Computers原评论 ↗
推荐jcroll · 2013-09

“The PHP community is moving forward and trying to do things the right way. Checkout PHP”

用它说明 PHP 社区正在改进做事方式
HHVM is fast – too bad it doesn’t run my code原评论 ↗
推荐jtreminio · 2013-09

“There's also websites like PHP The Right Way [1] that act like a collection of best practices.”

把它当作 PHP 最佳实践的合集推荐
What are the best languages for aspiring programmers in 2014?原评论 ↗
推荐smacktoward · 2013-11

“Resources like PHP the Right Way help counter this”

认为它能纠正过时的 PHP 教程
As Oracle axes support for GlassFish, MySQL users might want to pay attention原评论 ↗
看全部 20 条 →
推荐fein · 2013-11

“one thing that would probably be wise is linking PHP somewhere in there to try and influence coders to not make bad decisions off the bat.”

建议放上它的链接,引导新手别一开始就做错决定
Learn PHP – Free interactive PHP tutorial原评论 ↗
推荐jqueryin · 2014-03

“Check out some of the works pointing the general populous in the right direction:”

把它列为给 PHP 开发者指明正确方向的资料
The new PHP原评论 ↗
推荐adamors · 2014-07

“PHP The Right Way [1] already covers the basics of modern PHP, without turning into a laundry list.”

称它涵盖现代 PHP 基础,又不流于罗列
So you want to be a PHP Developer?原评论 ↗
推荐aikah · 2014-08

“The creators should have a look at PHP which is really basic guidelines for any modern PHP project.”

建议作者参考它,说它是现代 PHP 项目的基本准则
Nemex – A tiny app that helps you to track and curate ideas and projects原评论 ↗
推荐fanalin · 2014-08

“PHP is also a goof landing spot.”

称它是个不错的落脚点
Ask HN: Where is the PHP community?原评论 ↗
推荐mcintyre1994 · 2014-09

“If you're looking for a solid php resource with a more modern and secure approach I'd recommend”

推荐它作为更现代、更安全的 PHP 资源
Ask HN: What have you been working on this summer?原评论 ↗
推荐ecaradec · 2015-04

“there is actually a very good website about the good parts of PHP: PHP”

推荐它作为讲 PHP 优点的好网站
PHP: The Good Parts原评论 ↗
推荐bkanber · 2015-06

“PHP is a great resource for most things you'll need to know when working with modern PHP. Definitely start here.”

称它涵盖现代 PHP 所需知识,建议从它开始
Ask HN: I'm starting a new job as a PHP developer tomorrow原评论 ↗
推荐yeskia · 2015-07

“Was hoping this would be similar to PHP: The Right Way where everything you need to know is on the one page with links for more information available”

拿它作对照:所需知识集中一页,再附链接深入
JavaScript best practices原评论 ↗
推荐bdg · 2015-10

“PHP is a good start.”

推荐它作为入门起点
Sculpin – PHP Static Site Generator原评论 ↗
推荐arien · 2015-12

“there are some good starting/best practices guides to help (that are regularly updated), such as:”

列为定期更新的入门与最佳实践指南之一
PHP 7 Released原评论 ↗
推荐cyphax · 2015-12

“I found PHP to be very useful.”

说它很有用,介绍现代 PHP
PHP 7 Released原评论 ↗
推荐superskierpat · 2015-12

“My final project in my php class last year was way better than it would of been due to one simple website: PHP”

说多亏这个网站,自己的 PHP 课程项目做得好得多
PHP 7 Released原评论 ↗
推荐devwerks · 2016-01

“Take a look at (链接) or PHP for some primers.”

推荐它作为 PHP 安全(如目录遍历)的入门材料
Show HN: Mejiro – single-file photo hosting PHP app原评论 ↗