[Yaml] fix falsely triggered deprecation
This commit is contained in:
parent
c71868d06f
commit
89dd69ac27
@ -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) {
|
||||
|
@ -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),
|
||||
|
Reference in New Issue
Block a user