Deleting entire PHP Class

后端 未结 3 1911
孤街浪徒
孤街浪徒 2021-01-11 20:56
class foo{
    ....
}

Say that class exists in my code, then later on I no longer need this class and wish to remove it (so I can replace it with a

3条回答
  •  爱一瞬间的悲伤
    2021-01-11 21:33

    You can use unset() to delete an object, but the class itself cannot be deleted. To be honest, modifying code like that at runtime sounds kludgy and confusing - is there not a better option?

提交回复
热议问题