1--TEST--
2Test strnatcmp() function : left align, whitespace, digits
3--CREDITS--
4Sol Richardson <sr5732358@hotmail.com>
5--FILE--
6<?php
7/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
8* Description: String comparisons using a "natural order" algorithm
9* Source code: ext/standard/string.c
10*/
11
12echo "-- Testing strnatcmp() function whitespace, left-align, digit --\n";
13echo "-- Leading whitespace, digits, string 1 longer --\n";
14$str1 = " 00";
15$str2 = " 0";
16var_dump( strnatcmp( $str1, $str2) );
17
18echo "-- Leading whitespace, digits, string 2 longer --\n";
19$str1 = " 0";
20$str2 = " 00";
21var_dump( strnatcmp( $str1, $str2) );
22?>
23--EXPECT--
24-- Testing strnatcmp() function whitespace, left-align, digit --
25-- Leading whitespace, digits, string 1 longer --
26int(1)
27-- Leading whitespace, digits, string 2 longer --
28int(-1)
29