aply PHP5.3.x compatibility