but I have been doing it for two or three years now. This summary should be a summary of my past period.
PHP is a weakly typed language. The so-called typed language does not mean that there is no type distinction, but that there is no obvious type definition. PHP variables do not need to be defined in advance, only a $ symbol is needed, such as: $a/$b/$c. The underlying implementation of PHP variables is implemented using Union in C, but PHP variables will automatically perform type conversion during operation. Secondly, PHP variables use "reference copy" and "copy on write" mechanism.
There can be a state of not knowing how to learn, I feel that the realization of functions can be realized, there is nothing to learn, indeed there is nothing to learn in PHP itself in the later period, at this time you can try to learn some design patterns, Go look at some open source code, try to encapsulate MVC, and try to use the original PHP language to implement encapsulation in some frameworks. After reading this, you can try to take a look at the source code of PHP. Maybe you will find that the source code of PHP is still difficult to understand at this time. It doesn't matter. It is like this at the beginning. You can re-learn C language and c++, at this point you may find that going from c to c++ is actually an encapsulation process. You will also find that a large number of structures (structs), define, typedef, and a large number of one, two, and three pointers are used in the PHP source code. You will find that it is not that there is nothing to learn about PHP, but that you need to dig deeper. After that, you will have something to do in the next few days. Take a look at the source code of PHP, try to implement PHP extensions, and put it into your own environment. Call it.
It’s not that there is nothing to learn in the later stages of PHP, but the language itself is relatively simple. If you only learn things at the application level, there is really nothing to learn. Okay, after roughly reading the source code, you will find that php will be parsed into opcode and then executed. You will know the usage of apc, the concept of memcache and radius, and you will have a more in-depth understanding of php. Next, Let's turn to optimization. W PHP is a web development language, so it involves optimization when it involves web. How can it be optimized? Website bottlenecks generally exist in two places: one is the bottleneck of the database, and the other is the bottleneck of the PHP language. Database aspects: optimization of table structure, selection of mysql engine, addition of indexes, vertical table partitioning, horizontal table partitioning, master-slave database Reading and writing classification,clustering. In terms of PHP, we can start from optimizing css and js in the view layer, compress and merge css and js, process images, merge icons, etc. The controller layer optimizes SQL statements to reduce the use of related queries and subqueries. The SQL statements can be split and executed, and then the data can be combined. Use page static processing to process some pages that do not change frequently, use memcache/apc/radius as database cache to relieve database pressure, and use the opcode function to reduce php parsing (after php5.5, the built-in opcode eliminates apc, you can also use apc Implementation), choose the faster nginx instead of apache service, cluster the server, etc. Of course, there are also optimization techniques in the way PHP is written, such as the use of single quotes and double quotes, include The use of requirements and so on will not be described again. At this point you still have a lot to learn.
When you feel that there is no improvement in learning a weakly typed language, maybe you can learn a strongly typed language again. For example, when you learn java to make jsp, you will find that there is no session in jsp that you take for granted. You can Choose to use existing data structures such as map and hashmap to encapsulate the session. You may be used to the functions provided by the framework, but here, you really need to encapsulate a database link to read and return the data to a map. methods to facilitate your development.
When you feel that there is no improvement in learning PHP, maybe you should learn Linux. In fact, you don’t need to read many books, just switch to a Linux system and try to use it. You will find that Linux is actually more useful than Windows. You can use a set of lnmp/lamp, try to write some shell code, automatically back up your database, and even follow your PHP to achieve certain functions. It is also very convenient to configure PHP's xdebug to try to use breakpoints to debug PHP programs. It is also very convenient to write some PHP extensions, configure memcache, etc. You can try to use vim to write something and try to use Gcc compiles c, try to use gdb to debug the program, try to use the command line to do more things, you will find that php is actually a perfect match for Linux.
练 At this time, you can already use Linux proficiently. Why not try to achieve a small framework yourself to analyze the skills in the common framework, PHP object -oriented, PHP magic function, how PHP can achieve polymorphism, how And how PHP runs in Apache, why nginx has higher performance than Apache, how to share sessions on multiple servers, how to use curl to call some interfaces for use in certain situations during the development process, and how to use serialize/unserialize To realize the serialization and storage of some data and the use of deserialization sessions, how to crawl the content of some websites, and how to improve some usage habits. In short, you still need to do a lot. It’s not that there is nothing to learn in PHP, but you should not stay in the coding stage. You should learn more in-depth things. Believe that when you feel that there is nothing to learn, there is a lot. Most of it is because your knowledge scope is still too small and your cognitive level is too shallow. Programming is not easy, it’s hard to learn and cherish it, and it’s not easy to find a job, so you should always work hard to improve yourself.