PHP versions are constantly being updated quickly. But how do I feel that many features are not used in many scenarios? Is it because PHP developers have made these features because of their own needs? PHP versions are constantly updated, but many features are useless.
Is it a small Application Scenario, or is it because the PHP development team has these features due to its own needs?
Reply content:
PHP versions are constantly updated, but many features are useless.
Is it a small Application Scenario, or is it because the PHP development team has these features due to its own needs?
No, yesYouNot available.
5.3 Namespace, which should be used frequently.
5.4 Traits.
Finally, if you still use trigger_error, you cannot use it.
Array syntax sugar.
I 'd like to explain how many versions I have used are integrated.
1. Accept the return value of the function as the if condition if (empty ())
2. foo () [0]
3. $ array = [1, 2, 4]
There are a lot more to remember
If you want to use someone else's code (packagist), how can you use it without a namespace?
[ "key" => "value"]
There is no reason to use the short definition of an array.
Try catch must use finally only 5.5
I wrote the code for N years under 5.2, and recently I was lucky enough to switch to 5.5. I feel that the code is full of new features.
It takes time to verify that the old project may not be very large, and new projects, especially some frameworks, will be applied first.
Hosts with their own environment configuration can be used, which is really easy to use. Many VM instances and cloud hosts are still 5.3 not upgraded.
The company develops projects by itself, so we can keep up with the latest version.
Namespace is almost useless. We are all underline parties.
The array is quite good. You can use a lot of words to protect your fingers and joints.
Traits does not know how to use it, nor does it have a strong demand.
5.6.0 what I like most is variable parameters. Well, it's good to encapsulate databases. I always like sprintf style.
Two new features of PHP in the future under sci-fi:
1. Use + to connect strings and use. To sort class members.-> disappear
2. Strong type (affected by various pitfalls of MongoDB)
Our server is still at 5.3.17
The appearance of trait, the world view began to tangle, whether to use mixin or inhert
It is better to upgrade from 5.2 to 5.3 in China.
New features are often used in the Framework, so they are not used. As justjavac said, they are personal and corporate issues.
The namespace and closure functions of 5.3 are already standard in some new foreign class libraries and frameworks. This knowledge is required if you read the source code of other open-source projects.
We recommend that you upgrade to at least 5.3.
In addition, security and operational efficiency are also one reason for version upgrade.
Phpng next generation php ..
For private projects, follow the official new version. for open-source projects, take care of the old version. Currently, compatibility with 5.3 is a good choice.
I recommend my article: Detailed description of the new features in PHP from 5.2 to 5.6.