Should I upgrade my PHP server to version 5.3?

I have php 5.2.11 on my server. Should I upgrade to the new PHP 5.3.2?

Any new features that could save my life?

Any suggestions?

+3
source share
6 answers

The most remarkable thing is that 5.3 is faster. How much depends on your system and code, many say this is remarkable.

The migration guide http://php.net/migration53 contains changes and new features. I personally like closing / anonymous functions.

+3
source

, 5.3. Lambdas , .

LSB, , , .

<?php
class A {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        static::who(); // Here comes Late Static Bindings
    }
}

class B extends A {
    public static function who() {
        echo __CLASS__;
    }
}

B::test(); // "B"

AFAIK, PHP < 5.3

+3

, , , , , 5.3 .

+2

- , array_search, array_map, array_reduce .

+1

changelog ' , .

0

PHP 5.3, , , PHP 5.3.

You can automate some of this testing with PHP 5.3. Compatibility codes with other rules - code that will not necessarily work 100%, but at least you no longer have to worry about a lot of problems.

0
source

Source: https://habr.com/ru/post/1749344/


All Articles