Doc #77487 [NEW]: array_diff_assoc

From: Date: Fri, 18 Jan 2019 21:05:34 +0000
Subject: Doc #77487 [NEW]: array_diff_assoc
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16341@lists.php.net to get a copy of this message
From: felipegryllo at gmail dot com Operating system: PHP version: 5.6.40 Package: *General Issues Bug Type: Documentation Problem Bug description:array_diff_assoc Description: ------------ Hello, everyone! Please, check this description: "Two values from key => value pairs are considered equal only if (string) $elem1 === (string) $elem2 . In other words a strict check takes place so the string representations must be the same." But this example say: <?php $array1 = array(0, 1, 2); $array2 = array("00", "01", "2"); $result = array_diff_assoc($array1, $array2); print_r($result); ?> Returns: Array ( [0] => 0 [1] => 1 ) See it: "are considered equal only if (string) $elem1 === (string) $elem2" if (2 === "2") It's false! But this function return like equals... Thanks, so mutch! -- Edit bug report at https://bugs.php.net/bug.php?id=77487&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77487&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77487&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77487&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77487&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77487&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77487&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77487&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77487&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77487&r=support Expected behavior: https://bugs.php.net/fix.php?id=77487&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77487&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77487&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77487&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77487&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77487&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77487&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77487&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77487&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77487&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77487&r=mysqlcfg

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