Bug #81687 [NEW]: Casting to int from array from boolean

From: Date: Thu, 02 Dec 2021 10:37:10 +0000
Subject: Bug #81687 [NEW]: Casting to int from array from boolean
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238111@lists.php.net to get a copy of this message
From: cryptooman at gmail dot com Operating system: Ubuntu 20.04 PHP version: 7.3.33 Package: *General Issues Bug Type: Bug Bug description:Casting to int from array from boolean Description: ------------ The issue is related to variables casting. Please see the small script at "Test script". Regards Test script: --------------- echo (int) []; // Prints 0 echo (int) (array) false; // Prints 1, expected 0 OR $x = false; $x = (array) $x; $x = (int) $x; echo $x; // Prints 1, expected 0 -- Edit bug report at https://bugs.php.net/bug.php?id=81687&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81687&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81687&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81687&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81687&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81687&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81687&r=support Expected behavior: https://bugs.php.net/fix.php?id=81687&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81687&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81687&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81687&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81687&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81687&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81687&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81687&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81687&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81687&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81687&r=mysqlcfg

« previous php.bugs (#238111) next »