re-added code that needs PHP 5.2 / 5.3
Merge branch 'stable'