Skip to content

Commit c8fca5d

Browse files
committed
Add parsing of hexadecimal strings for PHP 7
PHP 7 does not handle the hexadecimal notation in is_numeric checks anymore, so the detection needs to be implemented explicitly.
1 parent 0e70397 commit c8fca5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Util/XmlUtils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ public static function phpize($value)
200200
return false;
201201
case is_numeric($value):
202202
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
203+
case preg_match('/^0x[0-9a-f]++$/i', $value):
204+
return hexdec($value);
203205
case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
204206
return (float) $value;
205207
default:

0 commit comments

Comments
 (0)