I have been struggling with this for a few hours now. I am running CentOS 6.6. A few hours ago I was having issues with a Symfony project that required PHP 5.4+ because of some libraries required. So I installed version 5.4 and I used to have PHP 5.3.3.
PHP 5.4 allows some new features. Such as array shorthand declaration and binary data strings. Like this:
//array shorthand declaration
$arr = [1, 2, 3, 4]; //PHP +5.4
$arr = array(1, 2, 3, 4); //PHP 5.3.3
//binary data strings
0b001 //PHP +5.4
This is on the official documentation so here's a link to the source: https://secure.php.net/manual/en/migration54.new-features.php
However when executing those scripts I am getting errors as if I was not running PHP 5.4 for example I would get this one:
PHP Parse error: syntax error, unexpected '[' in /vendor/wisembly/elephant.io/src/Engine/AbstractSocketIO.php on line 44
And the line of code would be:
//does not work
$data = [$event, $args]; //PHP 5.4 syntax
//it works
$data = array($event, $args); //PHP 5.3.3 syntax
This is the output of running php -v on the terminal
PHP 5.4.43 (cli) (built: Jul 8 2015 12:08:50)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
So based on this output I know I am running PHP version 5.4, the only thing that occurs to me is that somehow there is a configuration error somewhere and it is still using PHP 5.3.
So my question is how do I know what version of PHP is Symfony using? Thanks.