Javatpoint Logo
Javatpoint Logo

DESTRUCTOR

  • PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++.
  • The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed in any order in shutdown sequence.
  • We create destructor by using "__destruct" function.

Example 1

Output:

DESTRUCTOR





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA