Cheating a Boolean Tree solutions

Cheating a Boolean Tree was solved using PHP by 2 contestants. Solution sizes: average 3507 bytes (shortest: 1437; longest: 5578).