This is an example of using .Net using the NetPhp library that is based on the COM/DOTNET classes.
You can use any .dll file, wether it is or not COM decorated and any of the .Net framework types out of the box. You can also target any version of the .Net framework.
<?php
$runtime = new \NetPhp\Core\NetPhpRuntime('COM', 'netutilities.NetPhpRuntime');
$runtime->RegisterAssemblyFromFile('/binaries/SpreadsheetLight.dll', 'SpreadsheetLight');
$runtime->RegisterAssemblyFromFile('/binaries/DocumentFormat.OpenXml.dll', 'DocumentFormat.OpenXml');
$runtime->RegisterAssemblyFromFile('/binaries/AjaxMin.dll', 'AjaxMin');
$datetime = $runtime->TypeFromName("System.DateTime");
$minifier = $runtime->TypeFromFile("Microsoft.Ajax.Utilities.Minifier", APPLICATION_ROOT . '/binaries/AjaxMin.dll');
$datetime2 = $runtime->TypeFromAssembly("System.DateTime", "mscorlib, ....");
$datetime->Instantiate();
echo $datetime->ToShortDateString()->Val(); $ticks = $runtime->TypeFromName("System.Int64")->Parse('98566569856565656');
$datetime->Instantiate($ticks);
echo $datetime->ToShortDateString()->Val(); $ticks = $runtime->TypeFromName("System.Int64")->Parse('98566569856565656');
$data = $timer->GetPhpFromJson();
var_dump($data);
$IsMonday = $runtime->TypeFromName("System.DateTime")->Now->DayOfWeek->
Equals($runtime->TypeFromName("System.DayOfWeek")->Enum('Monday'));
?>