views:

64

answers:

3

Is:

<%
Set Mail = Server.CreateObject("SomeCOMObject")

Set Mail = Nothing
%>

the same as:

<?php
$Mail = new COM("SomeCOMObject");

$Mail->Close(); // <---- Not sure about this
?>
+1  A: 

I beleive

$Mail = null;
unset($Mail);

Although I am likely mistaken.

MiffTheFox
One or the other is enough, depending on the exact intend (dunno what exactly `Nothing` does in ASP). You don't need to bleach, cut, slice, burn **and** kill a variable. :)
deceze
unset() also depends on variable scope. If unset() inside a function, even if passed by reference, only destroys the local variable.
Josh Stuart
+5  A: 
$mail = new Mail; //hello
unset($mail); //goodbye
Webarto
+4  A: 

You can set $var to equal nothing like this:

$var = null;

To completely release the variable from memory, you do this:

unset($var);
redwall_hp