xref: /PHP-8.3/Zend/tests/gh12457.phpt (revision 736032fe)
1--TEST--
2GH-12458 (Fix GH-12457: Fixed a bug in zend_memnistr)
3--FILE--
4<?php
5echo "Test case to ensure the issue is fixed.\n";
6var_dump(stripos('aaBBBBBb', 'b'));
7var_dump(stripos('aaBBBBBbb', 'b'));
8var_dump(stripos('aaBBBBBbbb', 'b'));
9var_dump(stristr('aaBBBBBb', 'b'));
10var_dump(stristr('aaBBBBBbb', 'b'));
11var_dump(stristr('aaBBBBBbbb', 'b'));
12
13echo "\n";
14echo "Test cases to ensure the original functionality is not broken.\n";
15var_dump(stripos('aaBBBBBbc', 'c'));
16var_dump(stripos('aaBBBBBbC', 'c'));
17var_dump(stristr('aaBBBBBbc', 'c'));
18var_dump(stristr('aaBBBBBbC', 'c'));
19?>
20--EXPECTF--
21Test case to ensure the issue is fixed.
22int(2)
23int(2)
24int(2)
25string(6) "BBBBBb"
26string(7) "BBBBBbb"
27string(8) "BBBBBbbb"
28
29Test cases to ensure the original functionality is not broken.
30int(8)
31int(8)
32string(1) "c"
33string(1) "C"
34