using Microsoft.CodeAnalysis.Scripting; var context = new ScriptContext(); var typeName = "System.Console"; var type = context.ResolveType(typeName);
use \Microsoft.CodeAnalysis\Scripting\ScriptContext; $context = new ScriptContext(); $typeName = "System.Collections.Generic.List`1[System.String]"; $type = $context->ResolveType($typeName);This example uses the PHP.Core library to create a new ScriptContext object and resolve the fully qualified type name "System.Collections.Generic.List`1[System.String]". The returned Type object can be used to declare a variable of type List