php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63962 trigger_error(): error massage is limited 1024 bytes instead of characters
Submitted: 2013-01-10 20:47 UTC Modified: 2013-01-12 00:39 UTC
From: takagi@php.net Assigned: frozenfire (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2013-01-10 20:47 UTC] takagi@php.net
Description:
------------
http://php.net/trigger_error

The description of the error_msg parameter says "It's limited to 1024 characters 
in length." but actually it's limited to 1024 bytes instead of characters.


Test script:
---------------
$m = str_repeat('Ä', 510) . '0123456789';

var_dump(strlen($m));             // 520 (= 510 + 10) characters
var_dump(mb_strlen($m,'UTF-8'));  // ... but 1030 (= 510*2 + 10) bytes in UTF-8

trigger_error($m);


Expected result:
----------------
int(1030)
int(520)
PHP Notice:  Ä ... Ä0123456789 in (filename)

Actual result:
--------------
int(1030)
int(520)
PHP Notice:  Ä ... Ä0123 in (filename)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-12 00:39 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=329090
Log: Indicated that error messages are truncated after 1024 bytes, instead of characters (not MB-aware).
Closes bug #63962.
 [2013-01-12 00:39 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2013-01-12 00:39 UTC] frozenfire@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 01:01:30 2024 UTC