xref: /php-src/ext/com_dotnet/tests/bug77578.phpt (revision dcc3255b)
1--TEST--
2Bug #77578 (Crash when php unload)
3--EXTENSIONS--
4com_dotnet
5--FILE--
6<?php
7// To actually be able to verify the crash during shutdown on Windows, we have
8// to execute a PHP subprocess, and check its exit status.
9$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
10$extension_dir = escapeshellarg(ini_get("extension_dir"));
11$script = <<<SCRIPT
12if (!extension_loaded('com_dotnet')) dl('com_dotnet');
13ini_set('com.autoregister_typelib', '1');
14new COM('WbemScripting.SWbemLocator');
15SCRIPT;
16$command = "$php -d extension_dir=$extension_dir -r \"$script\"";
17exec($command, $output, $status);
18var_dump($output, $status);
19?>
20--EXPECT--
21array(0) {
22}
23int(0)
24