Bug #52589 [Com]: com_exception when read array from object->property

2010-09-01 Thread bastard dot internets at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52589&edit=1

 ID: 52589
 Comment by: bastard dot internets at gmail dot com
 Reported by:stinger25 at yandex dot ru
 Summary:com_exception when read array from object->property
 Status: Open
 Type:   Bug
 Package:COM related
 Operating System:   WinXP
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

"Параметр является обязательным" = "The
parameter is mandatory" I'm assuming.  You appear to have Text() return
as a single string, meaning it won't behave like an array as you have
"$str = $obj->Text[$i];" implying.  Try "$str = $obj->Text($i);"
instead.


Previous Comments:

[2010-08-12 09:08:13] stinger25 at yandex dot ru

It's working if instead property write method.

VB6 Code

Public Function ReadText(index) As String

Dim ret As String

ReDim str_Text(3)

str_Text(0) = "Test zero string"

str_Text(1) = "Test first string"

str_Text(2) = "Test second string"



If ((index < 0) Or (index >= 3)) Then

ret = ""

Else

ret = str_Text(index)

End If

ReadText = ret

End Function



and in PHP page

Count;

print $j."";



for ($i=0; $i<$j; $i++)

{

//  $str = $obj->Text[$i];

$str = $obj->ReadText($i);

print $str.""   ;

}

?>

Actual result:

3

Test zero string

Test first string

Test second string


[2010-08-12 08:52:30] stinger25 at yandex dot ru

Description:

I have small test ActiveX DLL writen in VB6.

It is code of DLL:

Option Explicit

Private str_Text() As String

Public Property Get Text(index As Integer) As String

ReDim str_Text(3)

str_Text(0) = "Test zero string"

str_Text(1) = "Test first string"

str_Text(2) = "Test second string"

If ((index < 0) Or (index >= 3)) Then

Text = ""

Else

Text = str_Text(index)

End If

End Property

Public Property Get Count() As Long

Count = 3

End Property



When I trying read array from Text property PHP page generate error, but
in VB6 

it's working correct.

Test script:
---
Count;

print $j."";



for ($i=0; $i<$j; $i++)

{

$str = $obj->Text[$i];

print $str.""   ;

}

?>

Expected result:

3



Test zero string

Test first string

Test second string

Actual result:
--
3



Fatal error: Uncaught exception 'com_exception' with message 'Error
[0x8002000f] 

Параметр является обязательным. ' in 

C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php:8 Stack trace:
#0 

C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php(8): unknown()
#1 {main} 

thrown in C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php on
line 8






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52589&edit=1


Bug #52589 [Com]: com_exception when read array from object->property

2010-08-12 Thread stinger25 at yandex dot ru
Edit report at http://bugs.php.net/bug.php?id=52589&edit=1

 ID: 52589
 Comment by: stinger25 at yandex dot ru
 Reported by:stinger25 at yandex dot ru
 Summary:com_exception when read array from object->property
 Status: Open
 Type:   Bug
 Package:COM related
 Operating System:   WinXP
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

It's working if instead property write method.

VB6 Code

Public Function ReadText(index) As String

Dim ret As String

ReDim str_Text(3)

str_Text(0) = "Test zero string"

str_Text(1) = "Test first string"

str_Text(2) = "Test second string"



If ((index < 0) Or (index >= 3)) Then

ret = ""

Else

ret = str_Text(index)

End If

ReadText = ret

End Function



and in PHP page

Count;

print $j."";



for ($i=0; $i<$j; $i++)

{

//  $str = $obj->Text[$i];

$str = $obj->ReadText($i);

print $str.""   ;

}

?>

Actual result:

3

Test zero string

Test first string

Test second string


Previous Comments:

[2010-08-12 08:52:30] stinger25 at yandex dot ru

Description:

I have small test ActiveX DLL writen in VB6.

It is code of DLL:

Option Explicit

Private str_Text() As String

Public Property Get Text(index As Integer) As String

ReDim str_Text(3)

str_Text(0) = "Test zero string"

str_Text(1) = "Test first string"

str_Text(2) = "Test second string"

If ((index < 0) Or (index >= 3)) Then

Text = ""

Else

Text = str_Text(index)

End If

End Property

Public Property Get Count() As Long

Count = 3

End Property



When I trying read array from Text property PHP page generate error, but
in VB6 

it's working correct.

Test script:
---
Count;

print $j."";



for ($i=0; $i<$j; $i++)

{

$str = $obj->Text[$i];

print $str.""   ;

}

?>

Expected result:

3



Test zero string

Test first string

Test second string

Actual result:
--
3



Fatal error: Uncaught exception 'com_exception' with message 'Error
[0x8002000f] 

Параметр является обязательным. ' in 

C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php:8 Stack trace:
#0 

C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php(8): unknown()
#1 {main} 

thrown in C:\Inetpub\_web_script_\SKU_Buffer\docsgenerator\xls.php on
line 8






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52589&edit=1