From: Operating system: Windows 7 PHP version: 5.3.3 Package: mcrypt related Bug Type: Bug Bug description:resource type set to empty after bad mcrypt_generic_init call
Description: ------------ Calling mcrypt_generic_init() with bad values changes the resource type from mcrypt to Unknown. It seems like what should happen is that the resource type should remain the same and that mcrypt_generic_init should simply do nothing. Maybe output a warning (as it currently does) but not change the resource type. A bad call to curl_setopt(), for example, doesn't change the resource type from curl to Unknown as demonstrated thusly: <?php $curl = curl_init(); @curl_setopt($curl); var_dump($curl); ?> Per that it doesn't seem like a bad call to mcrypt_generic_init() ought to change anything either. Test script: --------------- <?php $mcrypt = @mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, ''); @mcrypt_generic_init($mcrypt, '', ''); var_dump($mcrypt); ?> Expected result: ---------------- resource(4) of type (mcrypt) Actual result: -------------- resource(4) of type (Unknown) -- Edit bug report at http://bugs.php.net/bug.php?id=52924&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52924&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52924&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52924&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52924&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52924&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52924&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52924&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52924&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52924&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52924&r=support Expected behavior: http://bugs.php.net/fix.php?id=52924&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52924&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52924&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52924&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52924&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52924&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52924&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52924&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52924&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52924&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52924&r=mysqlcfg