pagination php class and php (C++) extention