fixed freeing, added a testcase and fixed test complex-statics.phpt which issues an E_NOTICE error