Fix #2 for older versions of PHP