reimplemented php funnctionalities