Date: 08/09/02
- Next message: Jesus M. Castagnetto: "[PHP-DOC] cvs: phpdoc /en/reference/array/functions in-array.xml"
- Previous message: bsibaud <email protected>: "[PHP-DOC] #18835 [NEW]: /e in preg_replace not available in PHP3"
- Next in thread: jmcastagnetto <email protected>: "[PHP-DOC] #18840 [Opn->Csd]: Problem in example of in_array()"
- Reply: jmcastagnetto <email protected>: "[PHP-DOC] #18840 [Opn->Csd]: Problem in example of in_array()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: ahristov <email protected>
Operating system: All
PHP version: 4.2.2
PHP Bug Type: Documentation problem
Bug description: Problem in example of in_array()
I think there is a bug in an example on the in_array()'s manual page.
Example 3:
<?php
$a = array(array('p', 'h'), array('p', 'r'), 'o');
if (in_array(array ('p', 'h'), $a))
echo "'ph' is found\n";
if (in_array(array ('f', 'i'), $a))
echo "'fi' is not found\n";
if (in_array('o', $a))
echo "'o' is found\n";
?>
// This will output:
'ph' is found
'o' is found
-=-=-=-=-=-
Either the message for the second "if" must be :
"'fi' is found\n"
or
the condition must be changed as well as the output
if (!in_array(array ('f', 'i'), $a))
Output:
'ph' is found
'fi' is not found
'o' is found
Regards,
Andrey
-- Edit bug report at http://bugs.php.net/?id=18840&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18840&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18840&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18840&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18840&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18840&r=support Expected behavior: http://bugs.php.net/fix.php?id=18840&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18840&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18840&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18840&r=globals-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Jesus M. Castagnetto: "[PHP-DOC] cvs: phpdoc /en/reference/array/functions in-array.xml"
- Previous message: bsibaud <email protected>: "[PHP-DOC] #18835 [NEW]: /e in preg_replace not available in PHP3"
- Next in thread: jmcastagnetto <email protected>: "[PHP-DOC] #18840 [Opn->Csd]: Problem in example of in_array()"
- Reply: jmcastagnetto <email protected>: "[PHP-DOC] #18840 [Opn->Csd]: Problem in example of in_array()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

