Bug #44578 [Fbk->NoF]: Strange Behavior of PHP using COM Object
| From: | php-bugs at lists dot php dot net | Date: | Sun, 16 Feb 2020 04:22:05 +0000 |
| Subject: | Bug #44578 [Fbk->NoF]: Strange Behavior of PHP using COM Object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225592@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=44578&edit=1
ID: 44578
Updated by: php-bugs@lists.php.net
Reported by: hargael at gmail dot com
Summary: Strange Behavior of PHP using COM Object
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: COM related
Operating System: Windows XP
PHP Version: 5.2.5
Assigned To: cmb
Private report: N
New Comment:
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 "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-02-06 14:07:33] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2019-06-19 17:51:38] cmb@php.net
This should likely have been
$propriete->Value["Label"][0] = "New Label";
------------------------------------------------------------------------
[2018-05-05 19:36:58] requinix@php.net
Original report:
Description:
------------
I've a problem with COM objects.
It's very similar to the bug #33734. In fact, I think that it is the same problem but the bug
is supposed to be fixed since 5.1.0. I use the 5.2.5 and have the same problem.
Excuse me for my clumsy english, I hope that my report will be readable.
Reproduce code:
---------------
Here is the code :
<?php
// Creation of the COM object $obj_persist
$obj_persist = new COM("PERSIST.PersistCtrl.1")or die("Error");
$obj_appli = $obj_persist->Applications->Add($path);
$obj_unite = $obj_appli->Units->Add("foo");
$obj_instance = $obj_unite->objects->add($nom_instance);
$sous_objet = $obj_instance->collection("Objects");
$propriete = $sous_objet->Item("alm");
echo "Label Value : " . $propriete->Value("Label",0); //Returns the good
Value
// Test 1
$propriete->Value("Label",0) = "New Label";
// Fatal Error
//Test 2
$propriete->Value["Label",0] = "New Label";
// Invalid number of parameters.
Expected result:
----------------
I've tried many ways of writing the $propriete->Value["Label",0]. With (), [], mix
of both. I cannot write on the value.
I though it was a read-only value but when I tried with VBa, it worked perfectly. Here is the code.
Dim SsObjs as PrsCollObjects
Set SsObjs = MyInst.Collection("Objects")
Set MyObject = SsObjs.Item("Fault")
MyObject.Value("Label", 0) = "Défaut pompe 1"
Actual result:
--------------
Result of TEST 1 with () :
Fatal error: Can't use method return value in write context in C:\wamp\www\Test COM\index.php
on line 71
Result of TEST 2 with [] :
Fatal error: Uncaught exception 'com_exception' with message 'Error [0x8002000e]
Nombre de param?tres non valide. ' in C:\wamp\www\Test COM\index.php:69 Stack trace: #0
C:\wamp\www\Test COM\index.php(69): unknown() #1 {main} thrown in C:\wamp\www\Test COM\index.php on
line 69
Depending on the way I write with [], I also have an "Unexpected ','" error.
------------------------------------------------------------------------
[2018-05-05 19:36:11] requinix@php.net
...
------------------------------------------------------------------------
[2009-02-27 09:34:27] hargael at gmail dot com
Is there a way I can help in order to make this bug evolve ?
I can provide any requested logs and can perform tests to help to solve this problem because I
really need this feature.
I'm not really keen on using an ASP page to make this single function.
Regards.
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=44578
--
Edit this bug report at https://bugs.php.net/bug.php?id=44578&edit=1