#23167 [NEW]: Apache fails when field of some recordset is passed to "switch" operator.

From: Date: Fri, 11 Apr 2003 14:36:33 +0000
Subject: #23167 [NEW]: Apache fails when field of some recordset is passed to "switch" operator.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37566@lists.php.net to get a copy of this message
From: rart at mail dot ru Operating system: Windows XP PHP version: 4.3.1 PHP Bug Type: MSSQL related Bug description: Apache fails when field of some recordset is passed to "switch" operator. If I passed the recordset's field to the "switch" operator then Apache fails: ----- cut here (begin) ----- Apache.exe has encountered a problem and needs to close. We are sorry for the inconvenience. szAppName : Apache.exe szAppVer : 0.0.0.0 szModName : ntdll.dll szModVer : 5.1.2600.1106 offset : 00001d24 ----- cut here (end) ----- The following script can be used to reproduce the problem: ----- cut here (begin) ----- <? // establish connection to database $conn = new COM("ADODB.Connection"); $conn->ConnectionString = "driver={SQL Server}; " . "server=127.0.0.1; " . "database=mydatabase; " . "uid=sa; " . "Trusted_Connection=Yes"; $conn->ConnectionTimeout = 15; $conn->CommandTimeout = 30; $conn->Open(); // select some data $rset = new COM("ADODB.Recordset"); $rset = $conn->Execute("select myfield from mytable"); if (!$rset->eof) { // on the line below Apache will be failed switch ($rset->fields["myfield"]->value) { // ... } } ?> ----- cut here (end) ----- This problem can be avoided in the following way: ----- cut here (begin) ----- $value = $rset->fields["myfield"]->value; switch ($value) { // ... } ----- cut here (end) ----- As far as I can see this is the PHP's bug. Please let me know if I wrong. Below is some information about my workstation: MS Windows XP Professional SP1 MS SQL Server 2000 SP3 Apache 1.3.27 (installed like a service) PHP 4.3.1 If you need some additional information (e.g. some settings from "php.ini") please feel free to ask me. Best regards, Artem Rodygin. ----------- Rhonda Ltd. Vladivostok Russia -- Edit bug report at http://bugs.php.net/?id=23167&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23167&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23167&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23167&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23167&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23167&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23167&r=support Expected behavior: http://bugs.php.net/fix.php?id=23167&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23167&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23167&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23167&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23167&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23167&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23167&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23167&r=gnused

« previous php.bugs (#37566) next »