Variable reuse problem

php.internals

Frank M. Kromann

19 years ago
Hello Everyone, I have a small problem with the mssql extension and resources (Tested with PHP 5.2). If I use the same variable to store the resource for a result the second result is not always correct! // Example 1 does not work $rs = mssql_query("select 1"); $rs = mssql_query("select 3 select 2 select 1"); // Example 2 works fine $rs1 = mssql_query("select 1"); $rs2 = mssql_query("select 3 select 2 select 1"); // Example 3 works fine $rs = mssql_query("select 1"); mssql_free_result($rs); $rs = mssql_query("select 3 select 2 select 1"); // Example 4 works fine $rs = mssql_query("select 1"); unset($rs); $rs = mssql_query("select 3 select 2 select 1"); The registered destructor is called in all four situations. So why is there a difference between asigning a new resource value to a variable with and without the unset()? - Frank