Functions in PHP: Part 1 - Writing Your Own Functions
John Kary discusses 4 guidelines that if followed will result in clear, focused functions that are easy to read, reason about and reuse. Examples are shown in PHP.
as $user) { if (0 === strpos($user['name'], $letter)) { $filtered[] = $user; } } return $filtered; } 4. Control In and Out 3. One Return Type 1. Well Named 2. Change vs Same