Home Backend Development PHP Tutorial PHP is much better than you think

PHP is much better than you think

Jun 23, 2016 pm 01:42 PM

Rants about PHP are everywhere, and they even come from smart guys.When Jeff Atwood wrote yet another rant about PHP, it made me think about thegood parts of PHP.

对PHP的抱怨到处都有,他们有时甚至来自于一些聪明的人。当Jeff Atwood写下另类对PHP的抱怨的时候,它让我想起了PHP好的方面。

 

The biggest problem of these rants is that they come from peoplestuck in the old days of PHP. They either don't care or they don't want toadmit that PHP actually evolves at a very fast pace, both at the language levelbut also at the community level. In fact, it evolves much faster than any otherlanguage or web platform. It has not always been the case, but the last 5 yearshave been an amazing journey for PHP.

这些抱怨的最大问题在于他们的记忆仍然停留在对PHP过去的回忆上。他们既不关心也不想承认,实际上PHP发展的速度非常快,不管是在语言水平上还是在社区建设上都是如此。事实上,它比任何其他的语言或者Web平台的发展都要快。虽然不一直是这样,但过去的5年对于PHP来说是一个辉煌的5年

 

Before talking about the amazing things the PHP community hasachieved recently, let's have a look at some interesting numbers: PHP is usedby 77.9% of all the websites whose server-side programming language is known.WordPress is used by 16.6% of all the websites in the world. If you have a lookat the top three CMSes, for the websites that use a monitored contentmanagement system: Wordpress is first with 54.3%, Joomla is second with 9.2%,and Drupal is third with 6.8%. Three products written in PHP.

在开始谈论PHP社区最近取得的成就之前,让我们看一些有趣的数据:在已知的服务器端编程语言编写的网站的网站中,77.9%用到了PHP。在全世界所有的网站中,16.6%是使用了WordPress(PHP语言组成的框架)。看一下排名前三的CMSes----使用了监视的内容管理系统的网站:Wordpress以54.3%的使有率排名第一,Joomla以9.2%的使用率排名第二,Drupal以6.8%的使用率排名第三。这三个产品都是用PHP来编写的。

 

Now, let me tell you a secret, the PHP "tour de force":Despite the changes over the years, PHP is still the easiest language to learnfor non-technical people: it allows anyone to create dynamic websites fasterthan with any other technologies, it allows anyone to host websites cheaply andwithout any hassles. PHP is probably not the best designed language in theworld, but it lets you get things done, and you can't argue with that.

 现在,让我告诉你一个秘密,PHP的”绝技”:尽管这些年来一直在变化,但对于非计算机专业的人来说,PHP仍然是最容易学习的一门语言:它允许任何人创建动态的网站,并且创建的速度比任何其他的技术都要快,它允许任何人廉价的创建网站,使用网站而且没有任何麻烦。PHP可能不是世界上最好的设计语言,但它可以让你把事情完成,而你不能反驳这一点。

 

PHP, the Language (PHP这门语言)

PHP 5.0 (released in 2004) brought us a very solid object model...wait a minute, I'm talking about something released almost 8 years ago. Fastforward now. The latest PHP release, PHP 5.4, comes with all the bells andwhistles you might dream of in a modern web language: yes, PHP supportsnamespaces; yes, PHP supports closures; yes, PHP supports traits.

     PHP5.0(在2004年发布)给我们带来一个非常坚实的对象模型。等一下,我一直在讨论一些8年前就有的事情了。时间过得很快,最新发布的PHP版本是PHP5.4,它配备了所有的钟声和口哨声,这可能就是你做梦想的一种现代Web语言。似的,PHp支持命名空间;是的,PHP支持包;是的,PHP支持特性。

 

It took some time, but PHP 5.4 also comes with some nice syntacticsugar that makes the whole experience better than ever: yes, PHP supports [] todefine arrays; yes, PHP supports calling a method on a newly created object((new Foo())->bar()); yes, PHP supports getting an array item from anyexpression ($foo->bar()[1]).

它需要一些时间,但PHP5.4也带来了一些好的语法,这使得所有的体验比以前更好了。是的,PHP支持[ ]来定义数组;是的,PHP支持在创建一个新的对象的时候调用一个方法((new Foo())->bar());是的,PHP支持从一个表达式中获取一个数组。

 

PHP has even learned from its mistakes: register_globals andmagic_quotes are definitely gone.

PHP已经吸取了过去的教训:register_globals和magic_quotes这种定义已经被废弃了。

 

Last, but not the least, PHP even comes with a built-in web serverthat eases local testing... and it starts in a matter of micro-seconds.

最后,但并非最不重要是,PHP甚至还带有一个内置的Web服务器,使能在本地测试。它的启动也就是几微秒的事情。

 

Next challenges: How do we "upgrade" all the old tutorialstalking about PHP on the web? What is the best way to support the WebSockettechnology in a PHP application?

     下一个挑战:我们如何在Web上来升级所有关于PHP的旧教程?在一个PHP应用程序支持WebSocket技术最好的方法是什么?

 

PHP, the Ecosystem(PHP的生态系统)

Having a good language is great, but having a great ecosystem iseven better. And the PHP ecosystem has evolved a lot in the last few years.

    具有良好的语言是伟大的,但有一个很大的生态系统则是更好的。PHP的生态系统在过去的几年里发展了很多。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

See all articles