Both Eclipse and NetBeans throw errors about the use of anonymous functions. The error in NetBeans says The language feature not compatible with PHP version indicated in project settings
The code works but the IDEs doesn't seem to like it.
Should I be worried?
An anonymous function is a function that is not stored in a program file, but is associated with a variable whose data type is function_handle . Anonymous functions can accept multiple inputs and return one output. They can contain only a single executable statement.
Anonymous functions can be used as an argument to other functions or as an immediately invoked function execution.
Anonymous functions are often arguments being passed to higher-order functions or used for constructing the result of a higher-order function that needs to return a function. If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function.
The advantage of an anonymous function is that it does not have to be stored in a separate file. This can greatly simplify programs, as often calculations are very simple and the use of anonymous functions reduces the number of code files necessary for a program.
NetBeans: in the project settings, set the PHP version to 5.3
Same for Eclipse. In Project Properties, set PHP Interpreter to 5.3.
Also see
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With