8000 Support binary notation. · daifma/symfony@78de59d · GitHub
[go: up one dir, main page]

Skip to content

Commit 78de59d

Browse files
thundererfabpot
authored andcommitted
Support binary notation.
1 parent e617ddb commit 78de59d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public function getDataForPhpize()
127127
array('111,222,333,444', '111,222,333,444'),
128128
array('1111,2222,3333,4444,5555', '1111,2222,3333,4444,5555'),
129129
array('foo', 'foo'),
130+
array(6, '0b0110'),
130131
);
131132
}
132133
}

src/Symfony/Component/Config/Util/XmlUtils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ public static function phpize($value)
191191
return true;
192192
case 'false' === $lowercaseValue:
193193
return false;
194+
case strlen($value) > 2 && '0b' == $value[0].$value[1]:
195+
return bindec($value);
194196
case is_numeric($value):
195197
return '0x' == $value[0].$value[1] ? hexdec($value) : floatval($value);
196198
case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):

0 commit comments

Comments
 (0)
0