|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
13 + 23 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 09:03:46 2023 UTC