Annotation of embedaddon/php/ext/standard/tests/strings/bug60801.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #60801 (strpbrk() mishandles NUL byte)
! 3: --FILE--
! 4: <?php
! 5: $haystack = "foob\x00ar";
! 6: $needle = "a\x00b";
! 7:
! 8: var_dump(strpbrk($haystack, 'ar'));
! 9: var_dump(strpbrk($haystack, "\x00"));
! 10: var_dump(strpbrk($haystack, $needle));
! 11: var_dump(strpbrk('foobar', $needle));
! 12: var_dump(strpbrk("\x00", $needle));
! 13: var_dump(strpbrk('xyz', $needle));
! 14: var_dump(strpbrk($haystack, 'xyz'));
! 15: ?>
! 16: --EXPECT--
! 17: string(2) "ar"
! 18: string(3) "