fix compatibility for before php 5.3.0