Doc #53265 [Com]: Example too complicated

From: Date: Mon, 08 Nov 2010 18:01:40 +0000
Subject: Doc #53265 [Com]: Example too complicated
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5503@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 Comment by: frozenfire@php.net Reported by: marco at palzkill dot de Summary: Example too complicated Status: Open Type: Documentation Problem Package: Unknown/Other Function Operating System: Any PHP Version: Irrelevant Block user comment: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

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