Bug->Doc #47569 [Opn->Ver]: DOTNET cannot instantiate generic classes
| From: | cmb@php.net | Date: | Thu, 25 Jun 2020 15:04:33 +0000 |
| Subject: | Bug->Doc #47569 [Opn->Ver]: DOTNET cannot instantiate generic classes | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17669@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47569&edit=1
ID: 47569
Updated by: cmb@php.net
Reported by: Sekai dot yu at gmail dot com
-Summary: DOTNET Excpection error
+Summary: DOTNET cannot instantiate generic classes
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
Package: COM related
Operating System: Windows Server
PHP Version: 5.2.9
Block user comment: N
Private report: N
New Comment:
You can't instantiate System.Console, because that is a static
class, and that limitation is already documented[1].
You can't instantiate System.Collections.Generic.List, because
that is a generic class; that limitation has to be documented.
[1] <https://www.php.net/dotnet>
Previous Comments:
------------------------------------------------------------------------
[2009-03-05 09:23:00] Sekai dot yu at gmail dot com
Description:
------------
When i've tried to use DOTNET lib's i got an Excpetion errors in 90% of my classes
Tried: System.Console, System.Windows.Forms.MessageBox, System.Collection.Generic.List,
System.Windows.Drawing.Graphics (and moch more...)
Reproduce code:
---------------
<?php
/*
$console = new DOTNET("mscorlib", "System.Console");
$var = $console->ReadLine();
$console->WriteLine( "Hello world from PHP - " . $var );
unset( $var );
unset( $console );
exit();
*/
$list = new DOTNET("mscorlib", "System.Collections.Generic.List");
print $list->ToString();
?>
Expected result:
----------------
Veiwing the Console Commander like in Console APP In c# or use the list generic, grafics etc...
Actual result:
--------------
Fatal error: Uncaught exception 'com_exception' with message 'Failed to instantiate
.Net object [CreateInstance] [0x80131522] ' in C:\wamp\www\folder\index.php:2 Stack trace: #0
C:\wamp\www\folder\index.php(2): dotnet->dotnet('mscorlib',
'System.Collecti...') #1 {main} thrown in C:\wamp\www\folder\index.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47569&edit=1