1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00

Allowing "%unicode|string%" as a placeholder. In 6, this placeholder is resolved

to "unicode", in <6 to "string". This allows to easily write portable tests.
Patch by uw
This commit is contained in:
Lars Strojny
2008-07-23 16:10:14 +00:00
parent 5e1f4665e3
commit 8e5f71dc94

View File

@@ -1711,6 +1711,11 @@ COMMAND $cmd
if (isset($section_text['EXPECTF'])) {
$wanted_re = preg_quote($wanted_re, '/');
$wanted_re = str_replace(
array('%unicode\|string%', '%string\|unicode%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 ? 'string' : 'unicode',
$wanted_re
);
// Stick to basics
$wanted_re = str_replace('%e', '\\' . DIRECTORY_SEPARATOR, $wanted_re);
$wanted_re = str_replace('%s', '[^\r\n]+', $wanted_re);