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

From: Date: Thu, 30 Apr 2015 23:22:19 +0000
Subject: Doc #69555 [Asn->Csd]: [DE] unpredictable results with array_udiff example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12280@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: [DE] unpredictable results with array_udiff example -Status: Assigned +Status: Closed Type: Documentation Problem 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: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2015-04-30 23:20:59] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&revision=336706 Log: fixed #69555 ------------------------------------------------------------------------ [2015-04-30 22:47:15] cmb@php.net 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. ------------------------------------------------------------------------ [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 (#12280) next »