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
