Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8255557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:33:56+00:00 2026-06-08T01:33:56+00:00

class foo{ …. } Say that class exists in my code, then later on

  • 0
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 new class later)

Is it possible to delete an entire class from run time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:33:57+00:00Added an answer on June 8, 2026 at 1:33 am

    Use unset($classVariableName) to delete the instance and it will free the memory.

    If the definition of the class shouldn’t be there at run-time, then the class needs to be added in separate file and the file should be included only when it is require. So that you can have two different class definition with same class name. But having two different definition with same name is not a good way to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

class Foo(){ public List<string> SomeCollection; } I need to implement an event which can
class Foo{ int[] doop; public Foo(){ this.doop={1,2,3,4,5}; } } I can't compile this, Java
class foo { public: void say_type_name() { std::cout << typeid(this).name() << std::endl; } };
class Foo(bar: String) { import Foo.Bar def this() = this(Bar) // this line fails,
Class Foo has a variable List<Button> bar , how can I render each of
i have code: class foo { public: bar(const QString& s){} ..... }; int main()
class Foo(@BeanProperty var bar:String) { def setBar(d:Double) { bar = d.toString } } This
class Foo { private $_id; public function __construct (){ $this->_id = /*requesting variable name*/;
Given the following code: class foo { }; class bar: public foo { public:
class Foo { const MY_CONST = 'this is ' . 'data' ; //use of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.