mirror of
https://github.com/php/php-src.git
synced 2026-03-28 18:22:42 +01:00
New modulus range inference implementation has been verified using https://gist.github.com/nikic/67947ff92cf0e1f7e931f2f0d4cf817f. The computed bounds are not tight, but it seems to be very hard to compute tight bounds on modulus operations.
17 lines
285 B
PHP
17 lines
285 B
PHP
--TEST--
|
|
Bug #75938: Modulus value not stored in variable
|
|
--FILE--
|
|
<?php
|
|
function borken($columns) {
|
|
$columns = (int) $columns;
|
|
if ($columns < 1) return 0;
|
|
$count = count([1,2,3,4,5]);
|
|
var_dump($mod = ($count % $columns));
|
|
var_dump($mod);
|
|
}
|
|
borken(2);
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|
|
int(1)
|