if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]
then
    if [[ `php-config --vernum` -ge 50500 ]]
    then
        pecl config-set preferred_state beta
        printf "yes\n" | pecl install apcu
    else
        echo 'extension="apc.so"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    fi
    echo 'apc.enabled=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    echo 'apc.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
else
    echo 'extension="apc.so"' >> /etc/hhvm/php.ini
    echo 'apc.enabled=1' >> /etc/hhvm/php.ini
    echo 'apc.enable_cli=1' >> /etc/hhvm/php.ini
fi

if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]
then
    INI_PATH=~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

    if [[ `php-config --vernum` -ge 70000 ]] # PHP>=7.0
    then
        pecl config-set preferred_state beta
        printf "yes\n" | pecl install apcu
    elif [[ `php-config --vernum` -ge 50500 ]] # 7.0>PHP>=5.5
    then
        printf "yes\n" | pecl install apcu-4.0.8
    else # PHP<5.5
        echo 'extension="apc.so"' >> $INI_PATH
    fi
else
    INI_PATH=/etc/hhvm/php.ini
    echo 'extension="apc.so"' >> $INI_PATH
fi

echo 'apc.enabled=1' >> $INI_PATH
echo 'apc.enable_cli=1' >> $INI_PATH

Fix APC tests on Travis
Fix APC tests on Travis

APC released a new (beta) that requires PHP7.0...
