Refactor PHP's problems 1,10 to be more concise.