Box Factory solutions

Box Factory was solved using PHP by 2 contestants. Solution sizes: average 2392 bytes (shortest: 2323; longest: 2462).