#42753 [Opn->Bgs]: Example script contains errors

From: Date: Tue, 25 Sep 2007 08:22:55 +0000
Subject: #42753 [Opn->Bgs]: Example script contains errors
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-36@lists.php.net to get a copy of this message
ID: 42753 Updated by: rquadling@php.net Reported By: plonk at doramail dot com -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: MacOS PHP Version: Irrelevant New Comment: The example works great. Here is the output. array(3) { [0]=> string(5) "apple" [1]=> string(7) "banana " [2]=> string(11) " cranberry " } array(3) { [0]=> string(5) "apple" [1]=> string(6) "banana" [2]=> string(9) "cranberry" } Notice the different lengths for banana and cranberry. Previous Comments: ------------------------------------------------------------------------ [2007-09-25 08:01:39] plonk at doramail dot com Description: ------------ Example 2466 on the "trim" explanation page makes no sense, function "trim_value" isn't called anywhere, instead it uses "var_dump" from the example on top of it: <?php function trim_value(&$value) { $value = trim($value); } $fruit = array('apple','banana ', ' cranberry '); var_dump($fruit); array_walk($fruit, 'trim_value'); var_dump($fruit); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42753&edit=1

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