PHP has a history of more than 20 years from its birth. From the rise of the Web era to the ebb of the mobile Internet, various programming languages and technologies in the Field of Internet emerge in endlessly. Node.js, GO and Python are constantly challenging the position of PHP. What is the future of the PHP language? How should PHP programmers respond to future changes?
As one of the oldest Web backend programming languages, PHP has a very high market share in the world, second only to Java. According to the data from various job sites, PHP development positions are very high and the salary is very good. In fact, PHP has a higher market position than Java in small and medium-sized enterprises and Internet startups. Java is more advantageous in large enterprises, traditional software industry, and financial field. Node.js, GO, Python, Ruby and other languages are still hard to match PHP and Java.
The PHP language is where it is today because its designers have always been pragmatic and kept technical complexity under wraps. PHP language is simple to get started, easy to master, the program robustness is good, is not prone to Java, C++ and other languages as complex problems, such as memory leakage and Crash, trace debugging is relatively easy. PHP’s official standard library is very powerful, all kinds of functions can be found in the official standard library, including MySQL, Memcache, Redis, GD graphics library, CURL, XML, JSON, etc., so that developers can not find libraries everywhere. The PHP documentation is excellent, with detailed explanations and usage examples for each function. Third party class libraries and tools, code, projects are also rich. Developers can write and develop all kinds of software in PHP quickly and efficiently. There is still no programming language on the market that is easier to use than PHP. So PHP has a great future ahead of it, so instead of choosing a programming language, learn to use PHP in depth.
As an experienced PHP developer, I would like to give you ten suggestions for the future of THE PHP program, hoping to be helpful to you.
1. Composer
The first point is Composer. Dependency management in PHP has been made much easier since Composer was created. The program relies on several libraries and frameworks, which can be imported directly using Composer and installed using Composer Update. Solve various problems of loading external libraries in the past. Composer also has domestic mirroring, which is very fast. Most PHP open source projects now provide support for Composer. It is recommended that you use Composer in your projects to solve the problem of package management of PHP code, rather than using the original method of downloading source code and manual include.
2. PHP7
PHP7 has made a number of changes to the Zend engine, greatly improving the performance of the PHP language. Using PHP7, you can instantly double the performance of your applications. Even heavy-hitters like WordPress can run thousands of QPS in PHP7, which translates to a server handling 80 million requests per day. With PHP7, MySQL optimization, and Memcache and Redis for acceleration, this technical architecture can handle fairly large scale systems. With the exception of some platforms with hundreds of millions of users, average-sized systems are completely stress-free.
3. PSR
PSR is a PHP language development specification organized by PHP Framework Interop Group. PSR defines many rules, such as namespace, class name specification, coding style standard, Autoload, public interface, etc. It has now become the de facto standard in the PHP technology community. Many well-known PHP frameworks and libraries adhere to the PSR specification. PHP developers should learn the PSR specification and try to follow it when developing their programs.
4. Swoole
Is PHP still limited to Web sites in 2017? No, if you don’t already know Swoole, do so. Swoole’s slogan is to redefine the PHP language. Swoole is an asynchronous parallel communication engine that runs as an extension to PHP. Node.js has asynchronous callback Swoole, as does Go’s coroutine Swoole, which turns PHP on its head. Swoole PHP can be used to realize the Server program resident in memory, and can realize the programming development of TCP and UDP asynchronous network communication. In the past, PHP could only do a Web site, but now Swoole can do communication services that Java and C++ can only achieve, such as WebSocket communication, chat, push server, RPC remote call service, gateway, proxy, game server and so on. If you want to do something with PHP other than Web systems, Swoole is the place to go.
5. Laravel
One of the most popular PHP frameworks in recent years, the website claims to be a framework for Web artists, which shows how elegant this framework is. Laravel provides rich functional modules, simple API design and strong expression. It also has a vibrant community, lots of contributors, lots of third-party plug-ins, and a thriving ecosystem. Laravel uses a lot of Symfony2 components at the bottom and implements dependency management through Composer. If you’re struggling with what PHP framework to use, Laravel is the best choice. Laravel provides a command line tool based on Symfony. console implementation, powerful, integrated with a variety of project management, automatic code generation functions.
6. Phar
PHP5.3 has since supported a Java-like JAR package called Phar. Used to package multiple PHP files into a single file. This feature makes application packaging and componentization as easy in PHP as it is in Java. An application can be packaged as a Phar package and run directly in phP-FPM. In conjunction with Swoole, PHP server.phar can be executed from the command line to start the server in one click. PHP code packages can be packaged in Phar as components and placed in Swoole’s server container to load execution.
7. C/C++/GO
Any technology has its advantages and disadvantages. PHP, as a dynamic scripting language, has the advantage of being easy and efficient to develop. The disadvantage is poor performance. In intensive computing scenarios, it is dozens or even hundreds of times different from C and C++. In addition, PHP does not operate directly on the underlying layer and relies on extension libraries to provide API implementation. PHP programmers can learn a statically compiled language to complement the implementation. C/C++/Go are good choices. The experience of programming in a static language is completely different from that in a dynamic language, and the learning process can be much better.
After mastering C/C++ language, you can also read the source code of PHP, Swoole, Nginx, Redis, Linux kernel and other open source software to understand its underlying operating principle.
The latest version of Swoole now provides support for C++ extension modules that encapsulate the Zend API, making it easy to manipulate PHP in C++ and implement PHP extension functions and classes in C++.
8. HTML5
As a new generation of Web front-end standard, HTML5 has a very broad future and a very large market demand. From PC websites, B/S enterprise software, mobile web, apps, all of these areas are embracing HTML5, mastering HTML5 to survive the next wave of Internet technology.
9. Vue.js
In addition to writing background programs, a large part of the PHP programmer’s work is in the presentation layer, dealing with the browser front end. Are you still using jQuery to manipulate DOM interface rendering in 2017? It’s completely out. It is now very easy to bind data to DOM elements using vue.js. After Ajax request background interface to return data, update front-end data to automatically achieve interface rendering. It will be too late to learn Vue in 2017.
React Native is a great choice if you’re not only writing Web apps, but also want to work with Android, IOS, and PC clients.
Deep learning/artificial intelligence
The future of the Internet belongs to artificial intelligence, and if you don’t understand machine learning, deep learning, and artificial intelligence, you need to learn it as soon as possible. Ai is now being deployed by Internet giants, including Google, Facebook, Microsoft, Amazon and China’s Baidu. Although it is still in the stage of scientific research, ai will be applied to all areas of the Internet in the future, including autonomous driving, big data analysis, online games, image recognition and language processing. Of course, the average engineer may not be able to participate in ai products yet, but should at least understand the basic concepts and principles of deep learning/AI.
I hope the above content can help you. Many PHPer will encounter some problems and bottlenecks when they are advanced, and they have no sense of direction when writing too many business codes. I have sorted out some information, including but not limited to: Distributed architecture, high scalability, high performance, high concurrency, server performance tuning, TP6, Laravel, YII2, Redis, Swoole, Swoft, Kafka, Mysql optimization, shell scripting, Docker, microservices, Nginx, etc. Many knowledge points can be shared for free, you can join my official group click here