需要 PHP 5.1.1 版本之前和 PHP 7.2.6 版本中带反斜杠的字符串示例

Need examples of strings with backslash in before PHP 5.1.1 version and in PHP 7.2.6 version

我在 PHP Manual

中看到以下句子

As in single quoted strings, escaping any other character will result in the backslash being printed too. Before PHP 5.1.1, the backslash in \{$var} had not been printed.

我想要在PHP 5.1.1之前的版本和中使用反斜杠字符串的例子]PHP 版本 7.2.6 表明在 PHP 5.1.1 之前,\{$var 中的反斜杠} 还没有打印,现在已经打印在 PHP 7.2.6.

<?php
$var = 'x';
var_dump("foo \" bar \{$var} foo");

5.1.1 - 5.6.30、hhvm-3.10.1 - 3.22.0、7.0.0 - 7.3.0alpha1 的输出

string(18) "foo " bar \{x} foo"

5.1.0 的输出

string(20) "foo " bar {$var} foo"

4.3.0 - 5.0.5 的输出

string(17) "foo " bar {x} foo"