Doc #80714 [Opn->Nab]: $a == $b it's false if $a and $b have the same key/value pairs

From: Date: Fri, 05 Feb 2021 13:01:57 +0000
Subject: Doc #80714 [Opn->Nab]: $a == $b it's false if $a and $b have the same key/value pairs
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18507@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80714&edit=1 ID: 80714 Updated by: daverandom@php.net Reported by: glushkov1997 at icloud dot com Summary: $a == $b it's false if $a and $b have the same key/value pairs -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Windows PHP Version: 7.4.15 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. ['15', '18'] and ['18', '15'] do not have the same key/value pairs, the keys are reversed. [ 0 => '15', 1 => '18', ] vs [ 0 => '18', 1 => '15', ] Previous Comments: ------------------------------------------------------------------------ [2021-02-05 12:56:19] glushkov1997 at icloud dot com Description: ------------ --- From manual page: https://php.net/language.operators.array --- Hello! var_dump(['15', '18'] == ['18', '15']); //it's false I think there is a documentation's mistake $a == $b Equality true if $a and $b have the same key/value pairs. Please check. Have a good day! Test script: --------------- var_dump(['15', '18'] == ['18', '15']); //it's false Expected result: ---------------- var_dump(['15', '18'] == ['18', '15']); // true Actual result: -------------- var_dump(['15', '18'] == ['18', '15']); //it's false ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80714&edit=1

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