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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

PHP in 2019

5 点作者 Supermighty大约 6 年前

2 条评论

idoubtit大约 6 年前
While I mostly agree, I think the PHP world it depicts is too rosy. The language itself is a bit chaotic and its enhancements are often half-baked.<p>For exemple, PHP5 introduced type declarations for functions, but only for arguments and custom types (object classes). PHP 7.0 extended these declarations to return values and internal types[1]. But having nullable types was implicit and restricted to some arguments and forbidden on return values, so PHP 7.1 had to introduce a new explicit syntax[2]. Now there are two ways to have nullable typed parameters, and, outside of the migration notes[2], only the old one (incomplete) is documented.<p>The post is right about the performance of modern PHP, but in the same time it advocates the use of the most prominent frameworks, which are rather slow. While Yii2 or CodeIgniter have a 20% overhead over raw PHP, Laravel and Symfony have a 80% overhead, i.e. 5 times slower[3]. YMMV, of course.<p>Composer is not mentioned in the post, though its main source is (Packagist). I think it has largely contributed to the better PHP ecosystem. Having worked recently with Python, I was frustrated by their lack of a similar standard tool.<p>[1]: <a href="https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;functions.arguments.php#functions.arguments.type-declaration" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;functions.arguments.php#functi...</a><p>[2]: <a href="https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;migration71.new-features.php" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;migration71.new-features.php</a><p>[3]: <a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r17&amp;hw=cl&amp;test=query&amp;l=zik073-1&amp;w=0-4zsow&amp;c=2&amp;d=d&amp;f=0-kasck-141czk-0-dbhkeq-13ydj4-3quio-hrd6o0-0" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r17&amp;hw=...</a>
评论 #19918839 未加载
MordodeMaru大约 6 年前
Missing Semantic Merge in tooling:<p><a href="http:&#x2F;&#x2F;blog.semanticmerge.com&#x2F;2019&#x2F;02&#x2F;semanticmerge-now-supports-php.html" rel="nofollow">http:&#x2F;&#x2F;blog.semanticmerge.com&#x2F;2019&#x2F;02&#x2F;semanticmerge-now-supp...</a>