TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What is your reason for not choosing to use PHP for your next project?

3 点作者 punkpeye超过 2 年前
I&#x27;ve been reading about different programming languages and, while I have limited exposure, it feels like PHP is one of the most mature languages designed specifically for creating websites. That being said, I rarely see it being talked about.<p>So what is your reason for not using PHP?

7 条评论

liberia超过 2 年前
It&#x27;s hard to code secure PHP. When starting, I was like: &#x27;So I can just pass a query parameter with &lt;script&gt;alert(1)&lt;&#x2F;script&gt; and do trivial XSS on random sites if I wanted to?&#x27; Smart PHP coders always sanitize, but for PHP newbies, it&#x27;s easy to introduce some vulnerabilities if you don&#x27;t do defensive coding practices.<p>There&#x27;s things like directory traversal attacks too (putting ..&#x2F;..&#x2F; in requests etc) which you have to prevent. PHP doesn&#x27;t do it for you, you have to be very defensive with it. Which is why I use PHP sparingly and use Python and Perl more. Those languages even still have potential vulns, but not nearly as bad as the ones you can introduce in PHP IMHO.
评论 #32727480 未加载
评论 #32727405 未加载
beardyw超过 2 年前
PHP suffers from being old, like JavaScript and C. All of those have gained the capabilities to make them perfectly useable but retain approaches we would not build into a new language. Some developers consider that a smell they don&#x27;t want to be associated with.<p>Those who develop code will care, those who develop function will not.
soueuls超过 2 年前
I have done some PHP in the context of modern WordPress before (Bedrock&#x2F;Sage&#x2F;Trellis). Meh. It&#x27;s sufferable but it did not give me immense joy.<p>I am mostly doing frontend but I want to find a productive full stack framework, I am still hesitating between Rails and Laravel. Still thinking of using Rails though.
yababa_y超过 2 年前
I&#x27;ve never used PHP before, why would I start now?
评论 #32726664 未加载
gregjor超过 2 年前
It’s not cool. Even people who use PHP every day don’t want to admit it because it’s not considered leading edge. It’s a workhorse language with a mature ecosystem, good documentation, and huge community, great for putting web sites together. It also gets used by a lot of newbs who write bad code, and the language gets blamed for that.
评论 #32728004 未加载
Princetobi超过 2 年前
Php is simple and easy to learn i prefer php than any other backend language
mrwnmonm超过 2 年前
It is ugly.