Fixing php error - return value in write context