Q:

How can I install Symfony 4 instead of Symfony 3.4?

I try to install Symfony 4 as per the documentation but keep ending up with version 3.4.
How can I install the correct version?
$ sudo apt update && sudo apt upgrade -y
$ php -v | head -n1
PHP 7.0.27-0+deb9u1 (cli) (built: Jan  5 2018 13:51:52) ( NTS )

$ composer clearcache
$ composer self-update
You are already using composer version 1.6.4 (stable channel).

$ composer create-project symfony/website-skeleton my_project
$ cd my_project && bin/console about | head -n4
 -------------------- ---------------------------------------------------- 
  Symfony                                                                  
 -------------------- ---------------------------------------------------- 
  Version              3.4.9 

In another question it was suggested you need php 7.2, how could I check that? The current Debian version seems to be 7.0.

A:

Symfony 4.0's symfony/website-skeleton package has a composer.json states a requirement of "php": "^7.1.3".
https://github.com/symfony/website-skeleton/blob/4.0/composer.json
(So does Symfony 4.0 itself, incidentally: https://github.com/symfony/symfony/blob/v4.0.0/composer.json)
You'll need to upgrade PHP to at least that version to use it. Until then, Composer will give you the latest version of the package that matches your PHP version.
The Symfony docs state this as well.

Symfony 4.0 requires PHP 7.1.3 or higher to run, in addition to other minor requirements.

