Made PHP 5.2 compatible to fix bug #7638.