Fix all compilation bugs for PHP 5.2.18-dev