I have a function that receives parameters as an array:
public myFunction($options = array("option1"=>true, "option2"=>true, "option4"=>"astring"), $anotherparameter = 0) {
if($options["option1"] === true) {
//And here all the magic is done
}
}
When I use it somewhere else I use something like this:
myFunction(["option1"=>false], 1) { //Magic }
I have installed PHP 5.5 on my localhost and this WORKS, when I upload it to my remote server it throws an error, and I have to put the array parameters like:
myFunction(array("option1"=>false), 1) { //Magic }
Is it due to PHP version? The remote server has PHP 5.3, I just updated it to 5.4, but I want to know if I need an specific version of PHP to work with this kind of array syntax, or should I use always array(...) format?