Doc #69555 [Asn]: [DE] unpredictable results with array_udiff example

From: Date: Thu, 30 Apr 2015 22:47:15 +0000
Subject: Doc #69555 [Asn]: [DE] unpredictable results with array_udiff example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12279@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69555&edit=1 ID: 69555 Updated by: cmb@php.net Reported by: buero at wehrstedt dot com -Summary: unpredictable results with array_udiff example +Summary: [DE] unpredictable results with array_udiff example Status: Assigned Type: Documentation Problem -Package: Arrays related +Package: Translation problem Operating System: XAMPP PHP Version: 5.4Git-2015-04-30 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: Ah, I see, thanks! The German translation of the array_udiff manual page is currently not up-to-date, and the example violates strict standards, so I suggest to ignore it. I'll update the translation ASAP. Previous Comments: ------------------------------------------------------------------------ [2015-04-30 22:13:14] buero at wehrstedt dot com In the German Manual, there is no example #2, there is just one. I meant this: function comp_func_cr($a, $b) { if ($a->priv_member === $b->priv_member) return 0; return ($a->priv_member > $b->priv_member)? 1:-1; } ------------------------------------------------------------------------ [2015-04-30 20:13:41] cmb@php.net To which example are you referring to? Example#2 uses $a == $b, what is correct, because DateTime instances are compared. ------------------------------------------------------------------------ [2015-04-30 19:35:26] buero at wehrstedt dot com Description: ------------ --- From manual page: http://www.php.net/function.array-udiff --- I tried out the example shown with function array_udiff. The example sets a property in the cr class, the compare function compares boolena instead of numerical. I tried this example; as soon as I changed to $a == $b instead of $a === $b, I've got the results I exspected. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69555&edit=1

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