ID: 21791 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: MSSQL related Operating System: windows PHP Version: 4.3.0 New Comment:
ok, I will try this tomorrow in the AM, but I have to ask: what has changed from 4.2.3 to 4.3.0 to make this type of implicit pass-by-reference thing happen? why does it work perfectly normally in 4.2.3? I could find nothing in the changelog that referred to this issue. Previous Comments: ------------------------------------------------------------------------ [2003-01-22 22:04:54] [EMAIL PROTECTED] About this: function spBindOutputParam($stmt, $name, &$outref, $type) { return mssql_bind($stmt, $name, &$outref, $type, true, false); } Have you tried adding 'error_reporting(E_ALL);' in the beginning of the script? You propably get some warnings? Try changing the call to: return mssql_bind($stmt,$name,$outref,$type, true,false); ie. don't pass $outref by reference, it's done internally.. ------------------------------------------------------------------------ [2003-01-21 14:54:03] [EMAIL PROTECTED] under PHP 4.3.0 in IIS5/sapi, the mssql_bind() function does not modify variables passed in for output parameters. ------------------------------------------------------------------------ [2003-01-21 14:52:37] [EMAIL PROTECTED] the following test script: function inner2(&$val) { $val = "Changed!"; } function inner(&$val) { inner2(&$val); } function outer(&$val) { inner(&$val); } $val = "The same."; outer(&$val); echo("val = ".$val."\n"); ... actually executes as it should on both 4.2.3 and 4.3.0 in my environment. I therefore would like to reopen the bug as one in the MSSQL extension on windows. ------------------------------------------------------------------------ [2003-01-21 00:58:49] [EMAIL PROTECTED] Please provide a _SHORT_ and _COMPLETE_ example script which can be used to reproduce this. ------------------------------------------------------------------------ [2003-01-21 00:55:10] [EMAIL PROTECTED] I upgraded PHP to 4.3.0, from 4.2.3, running in IIS5 as a SAPI module. I had hacked stored procedure support for MSSQL into the PEAR DB class with a function like: function spBindOutputParam($stmt, $name, &$outref, $type) { return mssql_bind($stmt, $name, &$outref, $type, true, false); } ... right? then, in my own DBAbstraction classes, I had something like: function bindOutputParam($name, &$outref, $type) { /// debugger global $debug; //$debug->println("DBStoredProcedure::bindOutputParam() called, outref = ".$outref."", 5); return $this->db_connection->spBindOutputParam($this->db_stmt, $name, &$outref, $type); } ... and so on, up through the layers of abstraction in my application framework, always passing the output parameter $outref by value. I upgraded to PHP 4.3.0 and it BROKE. the functions all completely failed to modify $outref. it works fine, I stress, in PHP 4.2.3. I desperately tried a bunch of stuff like removing the '&' from ONLY the function signatures, or ONLY the subsequent calls, or what have you. totally busted. has anyone run into anything like this? I'm guessing it's a PHP 4.2.3->4.3.0 thing but who knows? maybe also with MSSQL in PHP. let me know. thanks! -fish ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21791&edit=1