I was following this tutorial when typing up this code:
public function search($term){
$filter = function($tag) use ($term){
if(stristr($tag,$term))
开发者_StackOverflow中文版 return true;
return false;
};
return array_filter($this->_tags,$filter);
}
I get following errors in Zend Studio 8
syntax error, unexpected '{'
syntax error, unexpected 'function'
syntax error, unexpected 'use'
However the code works fine on my Xampp with php 5.3.1 - How can I find the version of PHP in Zend Studio, and how can I upgrade it?
You can change the PHP version used under Window > Preferences > PHP. There you can set the PHP executable and which PHP version to use. That should allow you to find out what version you're currently using (beware that you may have overriden it in your project) and upgrade it if you'd want to.
See the Zend Studio 8 User Guide (PDF) for more information.
Preferences -> PHP ->
- PHP Interpreter
- PHP Executables
- PHP Executables -> Execution environment
- Debug
精彩评论