some changes for php 5.2-compat, but I gave up. let's go for 5.3?
add notice that php > 5.3 is required