php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60999 DOTNET Same method with more parameters
Submitted: 2012-02-07 08:50 UTC Modified: 2020-02-06 16:01 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: viktor dot machnik at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: COM related
PHP Version: 5.4.0RC7 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: viktor dot machnik at gmail dot com
New email:
PHP Version: OS:

 

 [2012-02-07 08:50 UTC] viktor dot machnik at gmail dot com
Description:
------------
Calling a method with 0 parameters, one parameter, 2 parameters makes Problems, 
only the first method works, all others give an exception.

Test script:
---------------
<?php

$rnd = new DOTNET("mscorlib", "System.Random");

echo $rnd->Next(); //Work

echo $rnd->Next(10); //Fail

echo $rnd->Next(10, 16); //Fail

/* 
 - Error:
 Fatal error: Uncaught exception 'com_exception' with message 'Error [0x8002000e] Unzulässige Parameteranzahl.
' in [...]test.php:7
Stack trace:
#0 [...]test.php(7): dotnet->Next(10)
#1 {main}
  thrown in [...]test.php on line 7
*/


//After this error, script never ends.

?>

Expected result:
----------------
Fatal error: Uncaught exception 'com_exception' with message 'Error [0x8002000e] 
Unzulässige Parameteranzahl.
' in [...]test.php:7
Stack trace:
#0 [...]test.php(7): dotnet->Next(10)
#1 {main}
  thrown in [...]test.php on line 7

Actual result:
--------------
the methos with the lowest parameter count works

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-16 16:17 UTC] danbrown@php.net
Changed package, as this is not a php.net systems issue.
 [2012-05-16 16:17 UTC] danbrown@php.net
-Package: Systems problem +Package: Win32API related
 [2016-10-05 14:45 UTC] cmb@php.net
-Package: Win32API related +Package: COM related
 [2020-02-06 16:01 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-02-06 16:01 UTC] cmb@php.net
This behavior is to be expected, because COM does not support
overloaded methods directly; instead these get renamed by
appending an underscore and a number.  In this case you can use:

    echo $rnd->Next_3(10);
    echo $rnd->Next_2(10, 16);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 10:01:30 2024 UTC