fix compile errors on php 5.4