PHP compatibility layer