|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61363 Wrong defaults in htmlspecialchars() manual
Submitted: 2012-03-12 20:30 UTC Modified: 2012-03-12 21:34 UTC
From: tokul at users dot sourceforge dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.4.0 OS:
Private report: No CVE-ID: None
 [2012-03-12 20:30 UTC] tokul at users dot sourceforge dot net
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:

Expected result:
string(6) "&quot;"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-12 21:34 UTC]
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.
 [2012-03-12 21:34 UTC]
-Status: Open +Status: Not a bug
 [2012-03-13 17:08 UTC] tokul at users dot sourceforge dot net
> it helps to convey that ....

And it has nothing to do with htmlspecialchars function. Function sanitizes strings. It does not do anything related to doctype. Stop inventing new syntaxes for writing default values in documentation.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Apr 19 10:01:36 2021 UTC