|
Posted by Thomas Mlynarczyk on 11/16/06 16:27
Also sprach Jerry Stuckle:
> It doesn't make any difference what order the functions are in - they
> are only called when your code calls them directly or indirectly
> (i.e. a constructor). So whatever order you call them in is the way
> they will be called.
But I am not /calling/ these functions - it is PHP that decides when to call
them. I am merely registering two functions and instantiating an object.
> As for the variable - the object is destroyed, the destructor is
> called. But that's not what's happening here. You are calling the
> destructor, so it acts just like any other function.
Where am *I* calling the destructor in my code? I am merely /defining/ the
function __destruct() and I leave it up to PHP to decide when it is to be
executed.
> Rather, the destructor is called implicitly during script termination
> or when the variable goes out of scope. Like a constructor, you
> should not be calling a destructor.
But I am not calling it! Where in my code do I have a line that says
"$o->__destruct();"?
Greetings,
Thomas
Navigation:
[Reply to this message]
|