|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-11-14 09:36 UTC] idokan at gmail dot com
Description: ------------ The chr function translate a single Byte length integer into it's ASCII value. When providing a number bigger then 255, it returns the first byte instead of reporting an error about being out of range. Test script: --------------- echo chr(1000) . ' ' . ord(chr(1000)) . "\n"; Expected result: ---------------- chr must check the numeric boundaries and report on on an error when they are out of the range. Actual result: -------------- returns the first byte out of the result, making it appear like an integer overflow that the carry flag exception was captured. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 18:00:01 2025 UTC |
BTW, we'll have mb_chr()/mb_ord() from PHP 7.2 commit 087dcd9381c33057901dbe1ef89847d6fa87316d Merge: 4a3188f 15e32fd Author: Yasuo Ohgaki <yohgaki@php.net> Date: Wed Aug 10 09:47:27 2016 +0900 pull-request/1100 Request #65081 mb_chr() and mb_ord()