#45972 [Opn->Bgs]: Date escaping goes incorrectly

From: Date: Tue, 02 Sep 2008 11:46:23 +0000
Subject: #45972 [Opn->Bgs]: Date escaping goes incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-128610@lists.php.net to get a copy of this message
ID: 45972 Updated by: derick@php.net Reported By: woeterman at gmail dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux Debian PHP Version: 5.2.6 New Comment: That's because normal string escape rules still apply, and \t is the tab character. Previous Comments: ------------------------------------------------------------------------ [2008-09-02 11:37:42] woeterman at gmail dot com Description: ------------ When escaping with date("\t"), it shows up as nothing instead of 't'. It seems to work fine with other characters, such as \a Reproduce code: --------------- <?php echo "1: ". date("jS \of F Y H:i:s"). "<br />"; echo "2: ". date("jS \of F Y at H:i:s"). "<br />"; echo "3: ". date("jS \of F Y \at H:i:s"). "<br />"; echo "4: ". date("jS \of F Y \a\t H:i:s"). "<br />"; echo "5: ". date("jS \of F Y \t H:i:s"). "<br />"; ?> Expected result: ---------------- 1: 2nd of September 2008 13:36:57 2: 2nd of September 2008 pm30 13:36:57 3: 2nd of September 2008 a30 13:36:57 4: 2nd of September 2008 at 13:36:57 5: 2nd of September 2008 t 13:36:57 Actual result: -------------- 1: 2nd of September 2008 13:36:57 2: 2nd of September 2008 pm30 13:36:57 3: 2nd of September 2008 a30 13:36:57 4: 2nd of September 2008 a 13:36:57 5: 2nd of September 2008 13:36:57 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45972&edit=1

« previous php.bugs (#128610) next »