1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/ext/com_dotnet/tests/gh8778.phpt
T
Christoph M. Becker 651e0cc187 Fix GH-8778: Integer arithmethic with large number variants fails
When casting a `variant` to `int`, we need to heed the proper `zval`
type, which is an signed 64bit integer on x64, while `VT_INT` is only
a signed 32bit integer.

Closes GH-8779.
2022-06-18 11:48:49 +02:00

19 lines
361 B
PHP

--TEST--
Bug GH-8778 (Integer arithmethic with large number variants fails)
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")) die("skip com_dotnet extension not available");
if (PHP_INT_SIZE < 8) die("skip for 64bit only");
?>
--FILE--
<?php
$int = 0x100000000;
var_dump(
$int,
new variant($int) + 1
);
?>
--EXPECT--
int(4294967296)
int(4294967297)