Adding php5 compatibility