What version of PHP is Symfony using? -


i have been struggling few hours now. running centos 6.6. few hours ago having issues symfony project required php 5.4+ because of libraries required. installed version 5.4 , used have php 5.3.3.

php 5.4 allows new features. such array shorthand declaration , binary data strings. 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 on official documentation here's link source: https://secure.php.net/manual/en/migration54.new-features.php

however when executing scripts getting errors if not running php 5.4 example one:

php parse error:  syntax error, unexpected '[' in /vendor/wisembly/elephant.io/src/engine/abstractsocketio.php on line 44 

and line of code be:

//does not work $data = [$event, $args]; //php 5.4 syntax  //it works $data = array($event, $args); //php 5.3.3 syntax 

this output of running php -v on terminal

php 5.4.43 (cli) (built: jul  8 2015 12:08:50)   copyright (c) 1997-2014 php group   zend engine v2.4.0, copyright (c) 1998-2014 zend technologies 

so based on output know running php version 5.4, thing occurs me somehow there configuration error somewhere , still using php 5.3.

so question how know version of php symfony using? thanks.

when run php -v, show cli's php version. not php version used script (run webserver).

you have multiple solutions version used webserver.

example function phpinfo(); in .php page.

<?php     phpinfo(); // outputs information php's configuration 

example directly command line (show same information displayed phpinfo())

php -i 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -