[Yaml] fix falsely triggered deprecation

This commit is contained in:
Christian Flothmann 2016-05-24 20:14:09 +02:00
parent c71868d06f
commit 89dd69ac27
2 changed files with 5 additions and 1 deletions

View File

@ -591,8 +591,11 @@ class Inline
case 0 === strpos($scalar, '!!binary '):
return self::evaluateBinaryScalar(substr($scalar, 9));
case preg_match('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar):
@trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
case preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
if (false !== strpos($scalar, ',')) {
@trigger_error('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
}
return (float) str_replace(array(',', '_'), '', $scalar);
case preg_match(self::getTimestampRegex(), $scalar):
if (Yaml::PARSE_DATETIME & $flags) {

View File

@ -292,6 +292,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase
array('"quoted string"', 'quoted string'),
array("'quoted string'", 'quoted string'),
array('12.30e+02', 12.30e+02),
array('123.45_67', 123.4567),
array('0x4D2', 0x4D2),
array('0x_4_D_2_', 0x4D2),
array('02333', 02333),