Bug #60999 [Opn->Nab]: DOTNET Same method with more parameters

From: Date: Thu, 06 Feb 2020 16:01:06 +0000
Subject: Bug #60999 [Opn->Nab]: DOTNET Same method with more parameters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225391@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60999&edit=1 ID: 60999 Updated by: cmb@php.net Reported by: viktor dot machnik at gmail dot com Summary: DOTNET Same method with more parameters -Status: Open +Status: Not a bug Type: Bug Package: COM related Operating System: Windows XP PHP Version: 5.4.0RC7 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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); Previous Comments: ------------------------------------------------------------------------ [2012-05-16 16:17:00] danbrown@php.net Changed package, as this is not a php.net systems issue. ------------------------------------------------------------------------ [2012-02-07 08:50:32] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60999&edit=1

« previous php.bugs (#225391) next »