php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65390 default argument of htmlentities() wrong in function signature in documentation
Submitted: 2013-08-05 09:22 UTC Modified: 2013-08-06 07:19 UTC
From: l dot felber at gmx dot ch Assigned:
Status: Closed Package: *Unicode Issues
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
 [2013-08-05 09:22 UTC] l dot felber at gmx dot ch
Description:
------------
---
From manual page: http://www.php.net/function.htmlentities#refsect1-
function.htmlentities-description
---

There is no actual bug, but the documentation on 
http://www.php.net/manual/en/function.htmlentities is inconsistent:

The default value of the $encoding parameter of the htmlentities function is in 
the signature on top 'UTF-8' and in the encoding-parameter description 'ISO-8859-
1' (which seems to be the actual default)

Expected result:
----------------
Default value should be shown as 'ISO-8859-1' in function signature.

Well actually you should change the default in the implementation to 'UTF-8' (and 
maybe completely remove all support for all other encodings), but thats probably 
another issue ;-P


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-05 13:38 UTC] cmbecker69 at gmx dot de
The documentation on the encoding parameter states:

| Like htmlspecialchars(), htmlentities() takes an optional 
| third argument /encoding/ which defines encoding used in 
| conversion. If omitted, the default value for this argument 
| is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 
| from PHP 5.4.0 onwards.

From the function changelog:

| 5.4.0	 The default value for the encoding parameter was 
|        changed to UTF-8.

This is up-to-date in the German and French translation, 
but not in the *Italian* translation.

The documentation is correct, that $encoding defaults
to UTF-8 (verified for PHP 5.4.7, 5.4.13 and 5.5.0RC2).
 [2013-08-06 07:19 UTC] l dot felber at gmx dot ch
-Status: Open +Status: Closed -PHP Version: 5.5.1 +PHP Version: 5.3.2
 [2013-08-06 07:19 UTC] l dot felber at gmx dot ch
You're right. The only problem (or my problem) seems to be that one cannot see 
the old default values in the method signature. There's probably not much one can 
do against this (expect upgrading php version, which in my case, I currently 
can't). I'm closing the ticket becuase of that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC