garbage collection

With PHP, you do not need to
worry about reclaiming memory that is reserved for your variables or
objects. Although you can manually remove a variable or object with
the unset() function, there is usually no reason to do so—as with
variables, PHP will automatically clean up unused memory when
an object within a function goes out of scope, or at the end of the
script for global objects. Th e one exception involves open database
connections.because database connections
can take up a lot of memory, you should explicitly close a
database connection when you fi nish with it by calling the procedural
mysql_close() function or the close() method of the mysqli class.

One thought on “garbage collection”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s