diff --git a/src/Node/Literal/IntLiteralNode.php b/src/Node/Literal/IntLiteralNode.php index 94046c4..b725b80 100644 --- a/src/Node/Literal/IntLiteralNode.php +++ b/src/Node/Literal/IntLiteralNode.php @@ -50,13 +50,13 @@ private static function split(string $literal): array if ($literal[0] === '0' && isset($literal[1])) { return [$isNegative, match ($literal[1]) { // hexadecimal - 'x', 'X' => \hexdec(\substr($literal, 2)), + 'x', 'X' => \base_convert(\substr($literal, 2), 16, 10), // binary - 'b', 'B' => \bindec(\substr($literal, 2)), + 'b', 'B' => \base_convert(\substr($literal, 2), 2, 10), // octal - 'o', 'O' => \octdec(\substr($literal, 2)), + 'o', 'O' => \base_convert(\substr($literal, 2), 8, 10), // octal (legacy) - default => \octdec($literal), + default => \base_convert($literal, 8, 10), }]; }