Req #68777 [Com]: \a escape not supported for double-quoted strings and heredocs

From: Date: Fri, 15 Oct 2021 18:17:59 +0000
Subject: Req #68777 [Com]: \a escape not supported for double-quoted strings and heredocs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237228@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68777&edit=1

 ID:                 68777
 Comment by:         anthon dot pang at gmail dot com
 Reported by:        ajf at ajf dot me
 Summary:            \a escape not supported for double-quoted strings
                     and heredocs
 Status:             Open
 Type:               Feature/Change Request
 Package:            Strings related
 Operating System:   *
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

The "\b" (backspace) isn't supported in double-quoted strings either. (That said, the
sequence is supported in json_decode() per the spec, https://www.json.org/json-en.html).


Previous Comments:
------------------------------------------------------------------------
[2021-09-09 12:43:24] cmb@php.net

That doesn't look like a bug to me, but rather a feature request.

------------------------------------------------------------------------
[2015-01-09 18:16:13] ajf at ajf dot me

It would, but we have previously added \e, \v, \f, the first one in 5.4. I think it's an
acceptable break for a minor or major.

------------------------------------------------------------------------
[2015-01-09 11:50:40] anon at anon dot anon

Adding that would break backwards compatibility, so they will probably not do it without
overwhelming reason to, but you can always use "\7" instead.

------------------------------------------------------------------------
[2015-01-09 10:27:51] ajf at ajf dot me

Description:
------------
Despite the support for the completely useless \v (vertical tab), \a, which produces the familiar
terminal beep or flash that we all know and love, is conspicuously absent from PHP.

Test script:
---------------
<?php
echo "\a";

Expected result:
----------------
<terminal beeps/flashes/some other "alert" if supported>

Actual result:
--------------
\a


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



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


Thread (5 messages)

« previous php.bugs (#237228) next »