phpfacebookhiphop

PHP 5.4 and Facebook Hiphop compatibility


I was wondering does anyone know which of the features in PHP 5.4 are not supported in Facebook's Hiphop library. There's some questions on the Hiphop github wiki, such as this one, that very vaguely state :

HipHop does not currently support all PHP 5.4 features.

At the moment I just have to assume, for working purposes, all new features are not compatible as none are specified to work, if anyone has any insight on this that would be great, thanks in advance.


Solution

  • Stay away from the following:

    Trait Declaration:

    trait vehicleInfo {
        function getSpeed() { /*1*/ }
        function getWheels() { /*2*/ }
    }
    
    class Car extends Vehicle {
        use vehicleInfo;
        /* ... */
    }
    
    class Motorcycle extends Vehicle {
        use vehicleInfo;
        /* ... */
    }
    

    PHP 5.4 Array Instantiation:

    $array = [
        "name" => "John Smith",
        "job" => "Basketweaver",
    ];
    

    Function array dereferencing:

    function small_numbers() {
        return array (0, 1, 2);
    }
    
    echo small_numbers()[0];
    

    Class Member Access on Instantiation:

    (new Foo)->bar();