Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPied.com:
Resources are Passed by Reference
Sep 08, 2005 @ 11:03:32

PHPied has posted a quick reminder for reference when working with resources and references.

When copying one resource to another, you're actually creating a reference to the original resource, this is not an actual copy.

He gives example code using some of the GD functions to create an image resource, create a copy, imagedestroy the original, and try to print out the copy - the result is a resource type of "Unknown".

tagged:

Link:


Trending Topics: