Bug #73702 [NEW]: get_resource_type returns NULL instead of false

From: Date: Fri, 09 Dec 2016 14:21:12 +0000
Subject: Bug #73702 [NEW]: get_resource_type returns NULL instead of false
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14200@lists.php.net to get a copy of this message
From: martijn at openbsd dot org Operating system: irrelevant PHP version: Irrelevant Package: Documentation problem Bug Type: Bug Bug description:get_resource_type returns NULL instead of false Description: ------------ According to http://php.net/manual/en/function.get-resource-type.php get_resource_type should return FALSE if $handle is not a resource, but it returns NULL. I reckon that returning false is the proper response and that following the documentation is the more sane option. Test script: --------------- <?php var_dump(@get_resource_type("not_a_resource")); ?> Expected result: ---------------- bool(false) Actual result: -------------- NULL -- Edit bug report at https://bugs.php.net/bug.php?id=73702&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73702&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73702&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73702&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73702&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73702&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73702&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73702&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73702&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73702&r=support Expected behavior: https://bugs.php.net/fix.php?id=73702&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73702&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73702&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73702&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73702&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73702&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73702&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73702&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73702&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73702&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73702&r=mysqlcfg

« previous php.doc.bugs (#14200) next »