|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-10 13:51 UTC] wez@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 15:00:01 2025 UTC |
Description: ------------ Fatal error using the 'WScript.Shell' COM when accessing the registry on WIndows XP. Tried 5.0 RC3, 5.0, and latest Apache/1.3.31 (Win32) PHP/5.0.2-dev with same results. Reproduce code: --------------- This works correctly (reading a valid registry entry) $shell= &new COM('WScript.Shell'); $data=$shell->regRead('HKEY_CURRENT_USER\Environment\TEMP'); The following causes a fatal error if the registry key does not exist $shell= &new COM('WScript.Shell'); $data=$shell->regRead('HKEY_CURRENT_USER\Environment\TEMP11111'); This used to work correctly in 4.x versions of PHP. Expected result: ---------------- Not to get a fatal error but a NULL if a registry entery does not exist. Actual result: -------------- Fatal error: Uncaught exception 'com_exception' with message 'Source: WshShell.RegRead Description: Unable to open registry key "HKEY_CURRENT_USER\Environment\TEMP11111" for reading.' in f:\web\test.php:3 Stack trace: #0 {main} thrown in f:\web\test.php on line 3