cakephp - Anonymous functions not working in PHP 5.5.x -


so, here small code snippet project

if (!empty($user['industryuser'])) {     $user['industryuser'] = array_filter($user['industryuser'], function ($ku) {         $k = !empty($ku['industry']['name']) ? trim($ku['industry']['name']): '';         return $k != '';     });       $userindustries = array();     foreach ($user['industryuser'] $ku) {         $userindustries[] = $ku;     }     $user['industryuser'] = $userindustries; } 

this code present inside model named user.php. , there shell script named fetchindustriesshell.php inside app/console/command, makes use of model. when run script command line, cake fetchindustries, following error

parse error: syntax error, unexpected t_function in d:\wamp\www\industry-svn\ app\model\user.php on line 203 

where line 203, anonymous function defined(line 2 code snippet).

what tried is

1) run phpinfo() inside bootstrap.php verify php version. shows php 5.5.12 (attached screenshot).

2) installed xampp,to verify if wampp installtion/php libraries had problem. still got same error.

3) referred https://github.com/cakephp/debug_kit/issues/134. did not either.

  • cakephp version used is: 2.5.1
  • project running on: wampp (local) enter image description here


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -