Edit report at http://bugs.php.net/bug.php?id=51294&edit=1

 ID:               51294
 Updated by:       pierr...@php.net
 Reported by:      jnelson11 at gmail dot com
 Summary:          09 is no longer a valid value for chr() function
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Strings related
 Operating System: centos 5.3
 PHP Version:      5.3.2

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

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 



http://php.net/manual/en/language.types.integer.php


Previous Comments:
------------------------------------------------------------------------
[2010-03-14 04:55:24] jnelson11 at gmail dot com

Description:
------------
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"

ord(chr(09));



// 5.3.2 returns "\t"

// 5.2.6 return "\t"

ord(chr(9));

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

Actual result:
--------------
actual result is 09 returns null


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51294&edit=1

Reply via email to