#40405 [Opn->Bgs]: htmlentities example is incorrect.
| From: | rquadling@php.net | Date: | Fri, 09 Feb 2007 10:57:54 +0000 |
| Subject: | #40405 [Opn->Bgs]: htmlentities example is incorrect. | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969375394@lists.php.net to get a copy of this message | ||
ID: 40405
Updated by: rquadling@php.net
Reported By: ar3121 at att dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
The example is correct.
09/02/2007 11:00:05 C:\>php -n
<?php
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
^Z
A 'quote' is <b>bold</b>A 'quote' is
<b>bold</b>
Previous Comments:
------------------------------------------------------------------------
[2007-02-08 17:12:17] ar3121 at att dot com
Description:
------------
On the htmlentities function documentation page:
http://us2.php.net/htmlentities
Example 2262 is incorrect. The function call with and without
ENT_QUOTES produces different results, but the documentation says
they're the same.
Expected result:
----------------
<?php
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
Actual result:
--------------
<?php
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40405&edit=1