Doc #53265 [Opn->Csd]: Example too complicated
| From: | frozenfire@php.net | Date: | Mon, 08 Nov 2010 18:06:52 +0000 |
| Subject: | Doc #53265 [Opn->Csd]: Example too complicated | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5504@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53265&edit=1
ID: 53265
Updated by: frozenfire@php.net
Reported by: marco at palzkill dot de
Summary: Example too complicated
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Unknown/Other Function
Operating System: Any
PHP Version: Irrelevant
-Assigned To:
+Assigned To: frozenfire
Block user comment: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-11-08 19:06:32] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=305207
Log: Clarified example as per bug #53265.
------------------------------------------------------------------------
[2010-11-08 19:01:40] frozenfire@php.net
Using the bitwise and operator to determine whether a number is even or
odd is not all that complicated. In any case, it's evident to anyone
reading the example that the functions "odd" and "even" return whether
the input integer is odd or even.
The only potentially reasonable change is to add a comment to each
function indicating what it does.
------------------------------------------------------------------------
[2010-11-08 14:38:16] marco at palzkill dot de
Description:
------------
---
From manual page: http://www.php.net/function.array-filter#Examples
---
Hi,
the bitwise comparison with & in the callback function strikes me as too
complicated for beginners to easily understand, and thus rendering the
example sort of useless.
I use PHP a lot and had to look up &.
I would suggest to replace the return argument in the callback function
with something that is easier to understand.
Marco
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53265&edit=1