1--TEST--
2Test strncmp() function : usage variations - binary safe(null terminated strings)
3--FILE--
4<?php
5/* Test strncmp() function with binary values passed to 'str1' & 'str2' and with the null terminated strings */
6
7echo "*** Test strncmp() function: Checking with the null terminated strings ***\n";
8
9/* A binary function should not expect a null terminated string, and it should treat input as a raw stream of data */
10$str1 = "Hello\0world";
11$str2 = "Hello\0";
12var_dump( strncmp($str1, $str2, 12) );  //expected: int(5);
13
14echo "*** Done ***\n";
15?>
16--EXPECT--
17*** Test strncmp() function: Checking with the null terminated strings ***
18int(5)
19*** Done ***
20