|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51294 09 is no longer a valid value for chr() function
Submitted: 2010-03-14 04:55 UTC Modified: 2010-03-14 07:30 UTC
From: jnelson11 at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.2 OS: centos 5.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jnelson11 at gmail dot com
New email:
PHP Version: OS:


 [2010-03-14 04:55 UTC] jnelson11 at gmail dot com
you can no longer pass 09 int ascii value to chr() function to get a "\t" return value.

I was previously running version 5.2.6 of php on my server a upgraded to version 5.3.2

A few of my providers send ascii with preceeding zero.

Please let me know if 09 is no longer supported as a value that can be passed to chr().

Test script:
// 5.3.2 returns 0
// 5.2.6 return "\t"

// 5.3.2 returns "\t"
// 5.2.6 return "\t"

Expected result:
expected result is that both 09 and 9 should return "\t"

Actual result:
actual result is 09 returns null


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-14 07:30 UTC]
-Status: Open +Status: Bogus
 [2010-03-14 07:30 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

When a number is preceded by a 0 it mean that you're using an octal notation. So when you wrote 09 it was converted to 0 since 9 is not a valid octal.

If you want to print "\t" you can use chr(011)

011 = 9
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 15:01:28 2024 UTC