Bug #79859 [NEW]: Array with null is true

From: Date: Tue, 14 Jul 2020 15:00:51 +0000
Subject: Bug #79859 [NEW]: Array with null is true
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228039@lists.php.net to get a copy of this message
From: giolaza at gmail dot com Operating system: WIN 10 PHP version: 7.2.32 Package: *General Issues Bug Type: Bug Bug description:Array with null is true Description: ------------ Array with first element null is true Test script: --------------- $arr = [ 0 => null]; if ($arr) { echo 'is true'; } else { echo 'is false'; } //TEST 2 $arr = explode(',', null); if ($arr) { echo 'is true'; } else { echo 'is false'; } Expected result: ---------------- is false Actual result: -------------- is true -- Edit bug report at https://bugs.php.net/bug.php?id=79859&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79859&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79859&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79859&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79859&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79859&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79859&r=support Expected behavior: https://bugs.php.net/fix.php?id=79859&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79859&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79859&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79859&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79859&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79859&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79859&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79859&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79859&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79859&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79859&r=mysqlcfg

« previous php.bugs (#228039) next »