Bug #80836 [NEW]: is_array defies it own purpose by throwing fatal when passed an stdClass

From: Date: Fri, 05 Mar 2021 21:14:28 +0000
Subject: Bug #80836 [NEW]: is_array defies it own purpose by throwing fatal when passed an stdClass
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232582@lists.php.net to get a copy of this message
From: chris at summit-tech dot ca Operating system: Windows PHP version: 8.0.3 Package: Compile Failure Bug Type: Bug Bug description:is_array defies it own purpose by throwing fatal when passed an stdClass Description: ------------ This function has been rendered utterly useless as passing it some non-array objects such as stdClass results in a ridiculous error: Fatal error: Uncaught Error: Cannot use object of type stdClass as array Test script: --------------- $test->bla = "bla"; //Forcibly makes an stdClass obj if (is_array($test)){ echo "This doesn't run"; } Expected result: ---------------- is_array should return false and not stupidly throw a fatal Actual result: -------------- fatal error that defies the purpose of this function's entire existence -- Edit bug report at https://bugs.php.net/bug.php?id=80836&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80836&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80836&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80836&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80836&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80836&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80836&r=support Expected behavior: https://bugs.php.net/fix.php?id=80836&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80836&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80836&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80836&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80836&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80836&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80836&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80836&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80836&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80836&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80836&r=mysqlcfg

« previous php.bugs (#232582) next »