fix several compile error when using non-zts php env
adjust examples