I want to upgrade my server's PHP from 5.5 to 7, as I heard it will perform faster.
I read in the documentation that:
list() can no longer unpack string variables. str_split() should be used instead.
Currently I have a string quantity
variable which contains a string of comma seperated numbers, like 2,5,3
.
I'm using list
in order to create 3 new variables, one per each of these 3 comma separated values:
list($item[$key + 1]["red"], $item[$key + 1]["green"], $item[$key + 1]["blue"]) = explode(",", $item[$key + 1]["quantity"]);
Will this command no longer work on PHP 7? If so, how should I write it with str_split
?