1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/standard/tests/strings/bug54454.phpt
T
Max Kellermann c1a06704da Add ZEND_THREEWAY_COMPARE() macro to fix casting underflowed unsigned to signed (#8220)
Casting a huge unsigned value to signed is implementation-defined
behavior in C.  By introducing the ZEND_THREEWAY_COMPARE() macro, we
can sidestep this integer overflow/underflow/casting problem.
2022-06-08 13:24:18 +01:00

9 lines
162 B
PHP

--TEST--
Bug #54454 (substr_compare incorrectly reports equality in some cases)
--FILE--
<?php
var_dump(substr_compare('/', '/asd', 0, 4));
?>
--EXPECT--
int(-1)