# String BC break \{$a}

- Thread: https://externals.io/message/28562
- Original archive: https://news-web.php.net/php.internals/28562
- Started by Christian Schneider on 2007-03-23T02:16:13+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28562 — Christian Schneider — 2007-03-23T02:16:13+00:00

URL: https://externals.io/message/28562#28562

Hi there,
looking around quickly I couldn't find any documentation on the 
following change:
$a = "foo"; echo "\{$a}";

PHP 4.4.4: {foo}
PHP 5.2.1: \{foo}

I didn't check which exact version introduced this change. Some 
third-party code used this obscure construct and failed when migrating 
from PHP 4 to PHP 5.

Was this intentional and if yes, should it be documented in 
http://www.php.net/manual/en/migration5.incompatible.php ?

If this has been discussed before then I apologize.

Cheers,
- Chris

---

## #28567 — Tomas Kuliavas — 2007-03-23T06:29:01+00:00

URL: https://externals.io/message/28562#28567 · In reply to: #28562

> Hi there,
> looking around quickly I couldn't find any documentation on the
> following change:
> $a = "foo"; echo "\{$a}";
>
> PHP 4.4.4: {foo}
> PHP 5.2.1: \{foo}
>
> I didn't check which exact version introduced this change. Some
> third-party code used this obscure construct and failed when migrating
> from PHP 4 to PHP 5.
>
> Was this intentional and if yes, should it be documented in
> http://www.php.net/manual/en/migration5.incompatible.php ?
>
> If this has been discussed before then I apologize.

It was changed in 5.1.0-5.1.1 versions.

According to PHP Manual (http://www.php.net/language.types.string) curly
brackets are not escaped with backslash. Escape worked in older PHP
versions. It does not work in 5.1.1+.

http://bugs.php.net/31341
http://bugs.php.net/35411
