|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32161 com_exception message filed string reformat
Submitted: 2005-03-02 03:24 UTC Modified: 2005-03-20 18:11 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: baoshi dot zhu at gmail dot com Assigned:
Status: No Feedback Package: COM related
PHP Version: 5.0.3 OS: Windows XP/2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
5 + 41 = ?
Subscribe to this entry?

 [2005-03-02 03:24 UTC] baoshi dot zhu at gmail dot com
When a COM exception occurs, the error message produced by COM application can be obtained from 'message' in com_exception object. However the string is truncated with some characters wrapping to the front.

Reproduce code:
 try {
        $word = new COM("word.application"); 
        $doc = $word->Documents->Open($docfile);
    } catch (com_exception $e) {
        if ($doc) $doc->Close();
        if ($word) $word->Quit();
        print "Error occured at " . $e->getFile() . "(" . $e->getLine() . ")\n";
        print $e->getMessage() . "\n";

Expected result:
If $docfile does not exists, VBA will return

Error: This file could not be found.
Try one or more of the following:
*Check the spelling of the name of the document.
*Try a different file name. (c:\test1.doc)

Actual result:
Description: This file could not be found.
Try one or more of the following:
* Check the spelling of the name of the document.
 (C:\test1.doc)nt file name.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 16:39 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-03-20 18:11 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 12:01:29 2024 UTC