diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/standard/tests/array/rsort_variation7.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/standard/tests/array/rsort_variation7.phpt')
-rw-r--r-- | ext/standard/tests/array/rsort_variation7.phpt | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/ext/standard/tests/array/rsort_variation7.phpt b/ext/standard/tests/array/rsort_variation7.phpt new file mode 100644 index 0000000..a996bf6 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation7.phpt @@ -0,0 +1,96 @@ +--TEST-- +Test rsort() function : usage variations - boolean values +--FILE-- +<?php +/* Prototype : bool rsort(array &$array_arg [, int $sort_flags]) + * Description: Sort an array in reverse order + * Source code: ext/standard/array.c + */ + +/* + * Pass rsort() arrays of boolean values to test behaviour + */ + +echo "*** Testing rsort() : variation ***\n"; + +// bool value array +$bool_values = array (true, false, TRUE, FALSE); + +echo "\n-- 'flag' value is defualt --\n"; +$temp_array = $bool_values; +var_dump(rsort($temp_array) ); +var_dump($temp_array); + +echo "\n-- 'flag' value is SORT_REGULAR --\n"; +$temp_array = $bool_values; +var_dump(rsort($temp_array, SORT_REGULAR) ); +var_dump($temp_array); + +echo "\n-- 'flag' value is SORT_NUMERIC --\n"; +$temp_array = $bool_values; +var_dump(rsort($temp_array, SORT_NUMERIC) ); +var_dump($temp_array); + +echo "\n-- 'flag' value is SORT_STRING --\n"; +$temp_array = $bool_values; +var_dump(rsort($temp_array, SORT_STRING) ); +var_dump($temp_array); + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_NUMERIC -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_STRING -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} +Done
\ No newline at end of file |