In a foreach the expression on the left of the as should be the array that you want to iterate through, and the expression on the right is a variable that gets overwritten with the value of each element inside the array.
The reason that you get an error is because php is trying to write an element of $permission into explode(',', $permissionString), but this returns an error because explode(',', $permissionString) is a function call, not a variable, and only variables can be written to.
To fix this, try reversing the order of the as, like this:
foreach (explode(',', $permissionString) as $permission) {
foreach (explode(',', $permissionString) as $permission). As stated in the documentation:foreach (array_expression as $value).