fix docs and php 5.3 compatability