#38985 [Csd]: Can't cast COM objects to boolean
ID: 38985 User updated by: larry dot menard at rogers dot com Reported By: larry dot menard at rogers dot com Status: Closed Bug Type: COM related Operating System: Windows XP, SP2 PHP Version: 5.2.0RC4 Assigned To: ilia New Comment: Confirmed, it now works. Thanks! Previous Comments: [2006-10-06 12:25:18] [EMAIL PROTECTED] This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. [2006-10-06 12:05:39] [EMAIL PROTECTED] I think this one liner will do the job, but haven't been able to verify it: Index: com_handlers.c === RCS file: /repository/php-src/ext/com_dotnet/com_handlers.c,v retrieving revision 1.37 diff -u -p -r1.37 com_handlers.c --- com_handlers.c 29 Apr 2006 18:45:29 - 1.37 +++ com_handlers.c 6 Oct 2006 12:03:31 - @@ -539,7 +539,7 @@ static int com_object_cast(zval *readobj return SUCCESS; } - return FAILURE; + return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC); } static int com_object_count(zval *object, long *count TSRMLS_DC) cvs diff: Diffing tests [2006-10-06 06:48:00] [EMAIL PROTECTED] No idea why it was assigned to me. I've never had win32 build env. [2006-10-06 01:17:16] [EMAIL PROTECTED] batting back to you Tony; between moving offices this last week and a dead laptop I don't have a win32 build environment and won't have one in time to get this fixed for 5.2. As per our email discussion, I think the fix for this issue is to not return failure from the COM object cast handler in the case that we can't convert to variant bool, but to use regular PHP boolean cast at that point (after trying variant bool conversion) and returning success. ---- [2006-09-28 19:55:41] larry dot menard at rogers dot com Description: First of all, I'm usng RC5, not RC4 (RC5 is not in the list above). Can't cast an object of type COM to boolean. Reproduce code: --- $dbc = new COM('WinNT://Domain'); var_dump((bool)$dbc); Expected result: bool(true) Actual result: -- Catchable fatal error: Object of class com could not be converted to boolean -- Edit this bug report at http://bugs.php.net/?id=38985&edit=1
#38985 [NEW]: Can't cast COM objects to boolean
From: larry dot menard at rogers dot com Operating system: Windows XP, SP2 PHP version: 5.2.0RC4 PHP Bug Type: COM related Bug description: Can't cast COM objects to boolean Description: First of all, I'm usng RC5, not RC4 (RC5 is not in the list above). Can't cast an object of type COM to boolean. Reproduce code: --- $dbc = new COM('WinNT://Domain'); var_dump((bool)$dbc); Expected result: bool(true) Actual result: -- Catchable fatal error: Object of class com could not be converted to boolean -- Edit bug report at http://bugs.php.net/?id=38985&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38985&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38985&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38985&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38985&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38985&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38985&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=38985&r=needscript Try newer version:http://bugs.php.net/fix.php?id=38985&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38985&r=support Expected behavior:http://bugs.php.net/fix.php?id=38985&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38985&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38985&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38985&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38985&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38985&r=dst IIS Stability:http://bugs.php.net/fix.php?id=38985&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38985&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38985&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38985&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=38985&r=mysqlcfg
#30962 [Com]: Space being returned for NULL columns
ID: 30962 Comment by: larry dot menard at rogers dot com Reported By: richard dot quadling at bandvulc dot co dot uk Status: No Feedback Bug Type: MSSQL related Operating System: Windows XP Pro SP2 PHP Version: 5.0.3 New Comment: I seem to be having this same problem on PHP 5.1.2 (on Windows XP). Simple test script: Returns: C:\MyServer>php testMsSql_mssql.php array(2) { [0]=> string(1) " " ["g_theme"]=> string(1) " " } I know this is not correct, the actual content of that column is a 0-byte string: C:\MyServer>sqlcmd -d ... -S ... -U ... -P ... -e 1> select g_theme from g2_albumitem 2> go select g_theme from g2_albumitem g_theme (1 rows affected) 1> select len(g_theme) from g2_albumitem 2> go select len(g_theme) from g2_albumitem --- 0 (1 rows affected) 1> select 'x' + g_theme + 'x' from g2_albumitem 2> go select 'x' + g_theme + 'x' from g2_albumitem -- xx (1 rows affected) 1> Is anyone still working on this? It's been about 10 months since this bug was last updated. (Unfortunately I do not have a PHP Build environment.) Thanks. Previous Comments: [2005-06-21 20:59:48] robert dot sevcik at gmail dot com Hi, It'd be nice to see it working in php 5.1 because right now I am developing in php5. I've tried various php5 snaps and 5.0.4 stable without efect. I am on a Win2003 server and here is my try-case: string(1) " " ["len"]=> int(0) ["bin"]=> string(1) " " } 5.1.0-dev Thank you much :) */ ?> [2005-03-31 10:54:11] beschr at free dot fr Please ignore my precedent comment, the bug is still present in CVS. I test the mssql.dll today (latest snap: Built On: Mar 29, 2005 16:30 GMT) and the bug is still present. [2005-03-25 14:54:28] rantal at eoss dot ru Same problem still exist in php4 snapshot php4-win32-STABLE-200503230530.zip [2005-03-17 17:59:57] beschr at free dot fr I've got this problem too with php 5.0.3 on IIS/Windows XP Pro SP2. With the mssql.dll of this snaps: Built On: Mar 17, 2005 01:30 GMT it work great. So I think the correction in CVs is ok and you can close this bug. [2005-03-08 01:00:11] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30962 -- Edit this bug report at http://bugs.php.net/?id=30962&edit=1