mirror of
https://github.com/php/php-src.git
synced 2026-04-21 23:18:13 +02:00
c1a06704da
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.
9 lines
162 B
PHP
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)
|