compatibility patch for php 5.3