fny5jt9 发表于 2024-10-4 16:54:46

PHP语言变得没那样好,还有必要再用吗?


    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/X1wOHbVRDnyB1WPUkjR0toV4Zvdiae1Bu7ENCtCZHP68D1fRP2tfA4FgppLfvIiaF67Jv295Ac9gOpicB7eDkL1fw/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP在软件<span style="color: black;">研发</span>市场上,较之前几年,似乎有点下降。还有<span style="color: black;">有些</span><span style="color: black;">研发</span>人员对PHP持有不满意态度。某种程度上,这是正确的看法。在过去的几年中,PHP经历了一次大规模的重构,它是不是将错误的设计彻底<span style="color: black;">掰开</span>了呢?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我承认,PHP的确糟糕。我尚佯做不知的写了好<span style="color: black;">数年</span>PHP,我必须接受现今所有对PHP不友好的言论。可是这样做对吗?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">都数</span><span style="color: black;">研发</span>者对PHP语言的<span style="color: black;">广泛</span>态度是:不良的语言设计。</span><span style="color: black;">这种</span><span style="color: black;">言</span><span style="color: black;">论对</span><span style="color: black;">一个资深PHP<span style="color: black;">研发</span>者感到很尴尬,<span style="color: black;">乃至</span>对一颗工匠之心造<span style="color: black;">成为了</span><span style="color: black;">困惑</span>,曾经这个世界上最好的Web<span style="color: black;">研发</span>语言,<span style="color: black;">此刻</span>是如此的破,比Perl还“破”(并<span style="color: black;">无</span>对Perl语言有任何不敬之意)。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">然则</span>我想起最<span style="color: black;">起始</span>学编程时,<span style="color: black;">包含</span>自己与身边并不是计算机专业的人<span style="color: black;">叫作</span>赞,有<span style="color: black;">医生</span>还有摄影师,学液压的工程师,<span style="color: black;">她们</span>压根没学过神马编译原理,数据库,操作系统等专业课,但却<span style="color: black;">由于</span>PHP而疯狂的<span style="color: black;">爱好</span>上了网站<span style="color: black;">研发</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">就在几年前,在Quora上有一篇<span style="color: black;">文案</span>被广泛传播。这篇<span style="color: black;">文案</span>的作者是Quora的创始人Adam DAngelo。此<span style="color: black;">文案</span>的大意是PHP设计<span style="color: black;">欠妥</span>,<span style="color: black;">安排</span><span style="color: black;">欠好</span>,<span style="color: black;">研发</span>者<span style="color: black;">运用</span><span style="color: black;">状况</span>很是糟糕。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不妨回顾一下PHP刚<span style="color: black;">显现</span>的时候,它<span style="color: black;">起始</span>并<span style="color: black;">无</span>像<span style="color: black;">此刻</span><span style="color: black;">这般</span>被大规模应用。<span style="color: black;">因为</span>它的易用性,<span style="color: black;">非常多</span>人在各个<span style="color: black;">行业</span>都在用它来<span style="color: black;">研发</span>网站或单个应用。后来互联网发展越来越大,行业<span style="color: black;">出现</span>了转变,人们的<span style="color: black;">需要</span><span style="color: black;">亦</span>变了。PHP<span style="color: black;">好似</span>没咋变,还<span style="color: black;">显出</span>有点迟滞,这可能是PHP社区的<span style="color: black;">原由</span>,<span style="color: black;">例如</span>函数命名的的不一致,<span style="color: black;">例如</span>mysql_*之类的函数,还存在<span style="color: black;">有些</span>安全性问题。我用了<span style="color: black;">非常多</span>年的PHP,它还有不少陷阱,这让我<span style="color: black;">亦</span>感到比较痛苦。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">吐槽了半天PHP,是不是感觉很爽。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">然则</span>,如今<span style="color: black;">已然</span>快2020年,上面<span style="color: black;">说到</span>的那篇<span style="color: black;">文案</span>却写于2012年,如今人们仍然在热传和引用这篇<span style="color: black;">文案</span>,<span style="color: black;">人们的视野还是像当年那样的燥动和<span style="color: black;">茫然</span>。</span><span style="color: black;">因此呢</span>我想说两句,待俺擦亮自己钛金眼镜下的土狗眼,来总结一下PHP这两年<span style="color: black;">出现</span>的变化。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP在近年来<span style="color: black;">出现</span>了重大的更新。<span style="color: black;">例如</span>Facebook和PHP7从HipHop到HHVM的发展,不论是PHP官方还是应用<span style="color: black;">研发</span>者都<span style="color: black;">认识</span>到了问题的重要,<span style="color: black;">始终</span>到<span style="color: black;">此刻</span>你看到本文,社区和<span style="color: black;">研发</span>者<span style="color: black;">始终</span>在<span style="color: black;">处理</span>和改善这门语言。在2019年的今天,<span style="color: black;">倘若</span>你仍然<span style="color: black;">运用</span>mysql_*来<span style="color: black;">研发</span>,<span style="color: black;">或</span>把锅扔给PHP,<span style="color: black;">那样</span>你需要重新学习了。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">如同地域黑<span style="color: black;">通常</span>,编程语言的鄙视链不<span style="color: black;">晓得</span>啥时候<span style="color: black;">显现</span>的,不<span style="color: black;">晓得</span><span style="color: black;">为何</span>会存在这些东西?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">是的,只要有东西一旦受欢迎,火了,就会<span style="color: black;">导致</span><span style="color: black;">有些</span>人讨厌<span style="color: black;">乃至</span>谩骂。人们讨厌Java,说太重,配置繁琐,Oracle要收钱;人们讨厌C++,难学丑陋又低级等...</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">此刻</span>AI和人工智能火了,Python<span style="color: black;">起始</span>被人们所追捧,有人就拿它和PHP进行比较。</span><span style="color: black;">我对Python<span style="color: black;">无</span>成见,Python是一个很棒的语言,与PHP<span style="color: black;">同样</span>是脚本语言,但它发明的目的<span style="color: black;">便是</span><span style="color: black;">此刻</span>流行的AI/<span style="color: black;">设备</span>学习/数据科学吗?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">还有一个让我<span style="color: black;">没法</span>对Python完全接受的<span style="color: black;">原由</span>:Python运行太慢,尤其是用在网站<span style="color: black;">研发</span>上。如此说来,<span style="color: black;">倘若</span>你<span style="color: black;">抱怨</span>PHP代码丑陋,我就会说Python运行缓慢。这是<span style="color: black;">由于</span>,用Python需要<span style="color: black;">运用</span>框架<span style="color: black;">研发</span>。最<span style="color: black;">起始</span>时,我只是想用Python<span style="color: black;">研发</span>一个简单的程序来跑,而Python社区<span style="color: black;">举荐</span>我用Django或Flask。我不<span style="color: black;">爱好</span>臃肿的框架,<span style="color: black;">另一</span>在Python编程中,要小心空白或空格的坑。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">别外,Python的面向对象<span style="color: black;">亦</span><span style="color: black;">特别有</span>趣,它<span style="color: black;">运用</span>下划线来<span style="color: black;">拜访</span>对象修饰符。有人能够理解这个声明,但我更<span style="color: black;">爱好</span>显式的声明。Python确实是一个很棒的语言,它还有一个很棒的<span style="color: black;">研发</span>者社区,但仍然有人不<span style="color: black;">爱好</span>它。就像<span style="color: black;">咱们</span>自己觉得在任何<span style="color: black;">地区</span>都受到欢迎<span style="color: black;">同样</span>,这应该是一场<span style="color: black;">漂亮</span>的误会,<span style="color: black;">必定</span>会有人不<span style="color: black;">爱好</span>你。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">另一</span>,我个人<span style="color: black;">亦</span>不是很<span style="color: black;">爱好</span>JavaScript这个东西,当然这纯属个人观点。<span style="color: black;">有些</span>JavaScript帅哥<span style="color: black;">奋斗</span>游说我,Node.js<span style="color: black;">此刻</span><span style="color: black;">能够</span>充当PHP的角色,Node.js会比PHP、Java以及Python等后端语言更优秀,安全<span style="color: black;">况且</span>速度更快,我应该马上去学习Node.js,这些<span style="color: black;">伴侣</span>还说是PHP发明了SQL注入,我便无语了。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">回到PHP的<span style="color: black;">专题</span>。你<span style="color: black;">此刻</span>手里还有PHP4<span style="color: black;">乃至</span>更早的遗留代码吗?送<span style="color: black;">大众</span>一份新的编码<span style="color: black;">名单</span>:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1、<span style="color: black;">运用</span>OOP编程</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">你仍然<span style="color: black;">能够</span>编写面向过程的程序,但社区已朝着面向对象的<span style="color: black;">办法</span>发展。它完全匹配新模型,<span style="color: black;">能够</span>很好地构造代码。<span style="color: black;">运用</span>面向对象,自动隐含几种简洁的编码实践,例如SOLID和DRY。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">OOP<span style="color: black;">能够</span>让代码库有干净的结构,并使各部分的模块之间的分离更好。</span><span style="color: black;"><span style="color: black;">倘若</span>你<span style="color: black;">保持</span><span style="color: black;">爱好</span>编写意大利面条代码,<span style="color: black;">无</span>人拦着,你会让PHP最糟糕,<span style="color: black;">而后</span>给自己起个坏名字吧。任何编程语言都<span style="color: black;">能够</span>做到这一点。不只是PHP。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">2、<span style="color: black;">运用</span>严格的数据类型</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在编程时,要<span style="color: black;">运用</span>严格的数据类型。类似于:</span></p><span style="color: black;"><span style="color: black;">declare</span>(strict_types=1)</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">静态类型<span style="color: black;">能够</span><span style="color: black;">帮忙</span>数据保持一致和安全。PHP是一种动态类型的语言,有时需要排除该特性,<span style="color: black;">运用</span>严格的类型以及更安全的路径,<span style="color: black;">能够</span>使程序在运行时避免怪异和不可预测的错误。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">3、命名空间</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">到了PHP5.6之后,页面中include语句<span style="color: black;">再也不</span><span style="color: black;">平常</span>。<span style="color: black;">运用</span>命名空间来“import”导入需要“use”的模块。这是对原始PHP进行抽象的一种<span style="color: black;">办法</span>,即封装了include逻辑。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">刚一<span style="color: black;">起始</span>,<span style="color: black;">运用</span>“\”<span style="color: black;">做为</span>命名空间分隔符是有点怪异,<span style="color: black;">然则</span><span style="color: black;">咱们</span>会慢慢习惯它。<span style="color: black;">不消</span>再<span style="color: black;">运用</span><span style="color: black;">哪些</span>require或include语句,命名空间将代码放到正确的位置。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这让我又想到了以下<span style="color: black;">有些</span>要点。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">4、Artists</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">此刻</span>打算<span style="color: black;">起步</span>一个PHP项目,<span style="color: black;">能够</span><span style="color: black;">运用</span>Composer,这是一个包依赖关系管理工具,可让定义扩展包的依赖关系,应用程序和测试入口点,在需要时从Packagist中央存储库中加载依赖关系。Composer会生成一个Auto Loader自动加载器,这是<span style="color: black;">咱们</span>在<span style="color: black;">全部</span>项目<span style="color: black;">独一</span>对include的调用。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">5、抛弃mysql_*</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">mysql_* <span style="color: black;">已然</span>存在很长一段时间,如今所有函数都已被弃用,并<span style="color: black;">已然</span>在PHP 7中已将其永久删除。<span style="color: black;">倘若</span>你仍然抱怨mysql_*函数怎么<span style="color: black;">欠好</span>,你该升级你的PHP版本。到<span style="color: black;">日前</span>为止,处理数据库的最佳<span style="color: black;">办法</span>是PDO与prepare联用的方式。这是一个通用API,可与<span style="color: black;">海量</span>数据库很好地<span style="color: black;">协同</span><span style="color: black;">运用</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我<span style="color: black;">爱好</span>PDO的<span style="color: black;">地区</span>是纯净,相对现代化的设计,面向对象且一致性好。<span style="color: black;">倘若</span>你<span style="color: black;">刚才</span><span style="color: black;">起始</span>一个PHP项目,请立即转为<span style="color: black;">运用</span>PDO。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">另一</span>,不要<span style="color: black;">运用</span>和创建DB封装程序,<span style="color: black;">例如</span>DBConnection extends PDO。<span style="color: black;">倘若</span>需要<span style="color: black;">经过</span>PDO进行某种抽象,请<span style="color: black;">运用</span>Data Mapper和ORM Doctrine,不要用Active Record变体。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">6、分散你的担忧</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">之<span style="color: black;">因此</span>今天的PHP社区<span style="color: black;">显现</span>问题,有部分<span style="color: black;">原由</span>是官方社区的新开发人员将其搞得一团糟,有时感觉比JavaScript社区更糟(我感到很抱歉)。<span style="color: black;">因为</span>PHP易于学习和入门,<span style="color: black;">因此</span>新手经常写<span style="color: black;">有些</span>hacky硬编码并<span style="color: black;">安排</span>到生产环境中。而其他编程语言<span style="color: black;">无</span>这个能力,这是<span style="color: black;">由于</span>:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">a)学习曲线更陡峭;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">b)事先有着严格的设计策略;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">c) 严格的<span style="color: black;">安排</span>配置标准;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">咱们</span><span style="color: black;">经过</span>分散焦点来<span style="color: black;">处理</span>这类问题。我记得初学时,曾经曾经将函数的一部分代码直接复制粘贴到其他文件中,从而完成相同的功能,只是稍稍有<span style="color: black;">有些</span>修改。我<span style="color: black;">晓得</span><span style="color: black;">为何</span>初学者会<span style="color: black;">这般</span>干。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">首要</span>,请先给功能做减法。</span><span style="color: black;">将代码分解成小模块,让它们独立和单一地做一件事。<span style="color: black;">例如</span>有一个User类,它不<span style="color: black;">准许</span>有创建<span style="color: black;">信息</span>,加密<span style="color: black;">信息</span>并将<span style="color: black;">信息</span>发送给其他用户等功能。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">结合来自互联网的开源库,这些库发布前<span style="color: black;">已然</span>经过很好测试,能够很好地<span style="color: black;">处理</span>问题,<span style="color: black;">况且</span>做得更好。<span style="color: black;">研发</span>者应该更专注于业务<span style="color: black;">规律</span>,<span style="color: black;">运用</span>现有<span style="color: black;">办法</span>,不要产生紧密耦合。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">7、<span style="color: black;">运用</span>PSR</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">最后,严格遵循编码约定,并在PHP-FIG上阅读。PHP标准<span style="color: black;">意见</span>(PSR)会让你和团队有着一致的代码库,从而方便理解与扩展,且编写与项目兼容的代码,在集成过程中的标准<span style="color: black;">检测</span><span style="color: black;">能够</span>阻止烂代码,不会让你在写了<span style="color: black;">有些</span>代码后的3个月内大骂自己:)</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">此<span style="color: black;">意见</span><span style="color: black;">一般</span>适用于每种语言。遵循编码约定并<span style="color: black;">奋斗</span>编写更好的代码。当然,<span style="color: black;">无</span>人能阻止你<span style="color: black;">作为</span>“代码叛逆者”,还<span style="color: black;">无</span>发明阻止程序员写某种代码的技术。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">8、PHP在中国</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP在2008年到2012年是一个巅峰,有Discuz、PHPWind等现今仍流行的<span style="color: black;">制品</span>,尤其是当时Facebook等明星级<span style="color: black;">机构</span><span style="color: black;">运用</span>PHP做为<span style="color: black;">研发</span>语言,国内的门户<span style="color: black;">亦</span><span style="color: black;">运用</span>了PHP做为<span style="color: black;">所有</span>或前端语言。后来是<span style="color: black;">因为</span>移动端<span style="color: black;">研发</span>的兴起,使Web<span style="color: black;">研发</span><span style="color: black;">再也不</span>像以前<span style="color: black;">能够</span>前后通吃,这<span style="color: black;">包含</span>后端所有语言。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">PHP与<span style="color: black;">各样</span>语言的互通,<span style="color: black;">各样</span>硬件的互通,仍然是最方便的语言。PHP在国内的发展,比国外要更加普及,有新的PHP运行环境polar PHP,还有协程客户端Swoole,还有PHP的内核<span style="color: black;">研发</span>者鸟哥,PHP的几大框架Laraval、YII、ThinkPHP以及CodeIgniter,有两个是中国人<span style="color: black;">研发</span>的,即YII和ThinkPHP,这些都在让PHP7<span style="color: black;">研发</span>的<span style="color: black;">制品</span>性能和效能达到更佳。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">小结</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">仅管PHP语言很烂。但其它语言<span style="color: black;">亦</span>是如此,<span style="color: black;">咱们</span>只是用它们做为工具来完成任务。我不只一次看到,即便是用静态语言,二把刀的人用Java输出的<span style="color: black;">亦</span>是糟糕的代码。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">有一句话叫代码如诗,让自己和团队来写看起来像诗歌的程序,而不是丑陋的像打架<span style="color: black;">同样</span>的代码。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">如此一来,你<span style="color: black;">能够</span><span style="color: black;">安心</span>的用PHP<span style="color: black;">起步</span>下一个项目了,你和同事们会做更好的判断吗?同事可能太自由随便了,嗯,<span style="color: black;">亦</span>许<span style="color: black;">她们</span>的代码还在编译中。<span style="color: black;">此刻</span>就去做,语言是你的工具,写好<span style="color: black;">制品</span>的每行代码是你的工作。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">那样</span>问题来了,当有人再说“PHP是最好的语言”时,该<span style="color: black;">怎么样</span>说?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">以下是社区中的<span style="color: black;">有些</span>网友评论:</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">人类的爱:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">很好的总结。我<span style="color: black;">始终</span>在用PHP,<span style="color: black;">咱们</span>的API在PHP Slim 3框架上运行。<span style="color: black;">运用</span>了PSR、自动加载、Composer,这些对PHP社区做了重大改进。曾经,我最大的抱怨是PHP函数(尤其是字符串)参数<span style="color: black;">次序</span>不一致。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我<span style="color: black;">爱好</span>PHP是开放的。给桔子剥皮不<span style="color: black;">仅有</span>一种<span style="color: black;">办法</span>,这<span style="color: black;">便是</span><span style="color: black;">为何</span>我个人讨厌自以为是的语言和框架的<span style="color: black;">原由</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我<span style="color: black;">爱好</span><span style="color: black;">能够</span>在自选的任意Web服务器上运行它,<span style="color: black;">例如</span>在Apache的模块或Nginx的FPM上运行。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">语法种子:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">人们<span style="color: black;">始终</span>在引用2012年的<span style="color: black;">文案</span>!!</span><span style="color: black;">7年的发展<span style="color: black;">不应</span>焕然一新吗?</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">CS老兵:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不错的<span style="color: black;">文案</span>。我都看完了,说实话,我当年写了不少非常烂的php代码,<span style="color: black;">然则</span>后来<span style="color: black;">经过</span>用Laravel框架学习OOP帮我改变了<span style="color: black;">非常多</span>陋习。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">DAS:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">正确的结论。参数不一致是PHP的<span style="color: black;">重点</span>问题,真的需要<span style="color: black;">处理</span>。这有时真的很烦人。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">然则</span>得再说一次,用任何一种语言记住<span style="color: black;">每一个</span>参数<span style="color: black;">次序</span>都不太容易。擅用手册<span style="color: black;">或</span>一个不错的IDE/编辑器来帮我<span style="color: black;">弥补</span>是个好想法,<span style="color: black;">例如</span>PHPStorm就做得挺好。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">作者:老夏</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">当CPU飙升时,找出PHP中可能有问题的代码行</span></a></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">鸟哥惠新宸:</span><span style="color: black;">程序员应该<span style="color: black;">持续</span><span style="color: black;">提高</span><span style="color: black;">自己</span>的不可替代性</span></a></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">为何</span>Laravel会<span style="color: black;">作为</span>最成功的PH</span></a>P框架?</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/X1wOHbVRDnwwPKUyKTkVmx73aCEBJylXH0HJxOaabU6icC6PBArCtpIXmZtI42A7m57M6ibytNxdXLcVT0iauWSiaQ/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></span></a></p><strong style="color: blue;"><span style="color: black;">21CTO学院PHP全栈工程师隆重开营啦,报名<span style="color: black;">得到</span>一线互联网<span style="color: black;">机构</span>就业机会!</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/X1wOHbVRDnzUKLmMu36joe3huhWKCc6xpJJp2KdJlV1HsAdfb7dQ2GklLNib21UBn5N2C1zbiaDOg3licvobz5Qjw/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>




b1gc8v 发表于 2024-10-21 04:14:00

你的见解真是独到,让我受益匪浅。

b1gc8v 发表于 2024-10-30 08:24:18

百度seo优化论坛 http://www.fok120.com/
页: [1]
查看完整版本: PHP语言变得没那样好,还有必要再用吗?