addresses #157 for php5.2