使用来自MSSQL数据库的sqlsrv_prepare,sqlsrv_execute获取返回参数的值

The last parameter '$status' is suppose to return a 0 or 1. How do I get the value of that output parameter? Echoing $result always returns 1. The stored procedure works under classic asp and .NET, but I need to do it under PHP.

$conn = sqlsrv_connect($serverName, $connectionInfo);

if( $conn === false ) {
     die( print_r( sqlsrv_errors(), true));
}

$tsql = "{call spName(?,?,?,?)}"; 

$params = array(
                array(&$param1, SQLSRV_PARAM_IN),
                array(&$param2, SQLSRV_PARAM_IN),
                array(&$param3, SQLSRV_PARAM_IN),
                array(&$status, SQLSRV_PARAM_OUT)
                );

$stmt = sqlsrv_prepare($conn, $tsql, $params);

if($stmt===false ) {
    if( ($errors = sqlsrv_errors() ) != null) {
      die( print_r( sqlsrv_errors(), true));
}

$result = sqlsrv_execute($stmt);

if($result === false){
  die( print_r( sqlsrv_errors(), true));
}

echo " " . $result;

sqlsrv_free_stmt($stmt);
sqlsrv_close($conn);

Unbelievable, all I had to do was echo the output parameter itself ($status in this example) to see the result.