Doc #61363 [Opn->Nab]: Wrong defaults in htmlspecialchars() manual
| From: | cataphract@php.net | Date: | Mon, 12 Mar 2012 21:34:28 +0000 |
| Subject: | Doc #61363 [Opn->Nab]: Wrong defaults in htmlspecialchars() manual | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8050@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61363&edit=1
ID: 61363
Updated by: cataphract@php.net
Reported by: tokul at users dot sourceforge dot net
Summary: Wrong defaults in htmlspecialchars() manual
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
The documentation is correct. $x | 0 == $x for any integer $x. While the ENT_HTML401 constant could
be omitted from the default value, it helps to convey that the default document type is HTML 4.01.
Previous Comments:
------------------------------------------------------------------------
[2012-03-12 20:30:58] tokul at users dot sourceforge dot net
Description:
------------
You have typo in htmlspecialchars() manual (online version for 2012-03-12 date). ENT_COMPAT is not
the same as ENT_HTML401. Function can't have two different values as default.
ENT_COMPAT is int(2). ENT_HTML401 is int(0)
Sorry, if it is already fixed in source repo. I can see only online version and I can't find
htmlspecialchars related report on this problem.
Test script:
---------------
<?php
var_dump(ENT_COMPAT);
var_dump(ENT_HTML401);
var_dump(htmlspecialchars('"'));
Expected result:
----------------
int(2)
int(0)
string(6) """
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61363&edit=1