Improve php5.2 compatibility. fixes #92

By improve, I mean don't die a sad an only death when activated on php5.2