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/array_splice_variation4.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/array_splice_variation4.phpt')
-rw-r--r-- | ext/standard/tests/array/array_splice_variation4.phpt | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/ext/standard/tests/array/array_splice_variation4.phpt b/ext/standard/tests/array/array_splice_variation4.phpt new file mode 100644 index 0000000..d1cc501 --- /dev/null +++ b/ext/standard/tests/array/array_splice_variation4.phpt @@ -0,0 +1,69 @@ +--TEST-- +Test array_splice() function : usage variations - non array replacement values +--FILE-- +<?php +/* + * proto array array_splice(array input, int offset [, int length [, array replacement]]) + * Function is implemented in ext/standard/array.c +*/ + +function test_splice ($replacement) +{ + $input_array=array(0,1); + var_dump (array_splice ($input_array,2,0,$replacement)); + var_dump ($input_array); +} + +test_splice (2); + +test_splice (2.1); + +test_splice (true); +//file type resource +$file_handle = fopen(__FILE__, "r"); + +test_splice ($file_handle); +echo "Done\n"; +?> +--EXPECTF-- +array(0) { +} +array(3) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) +} +array(0) { +} +array(3) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + float(2.1) +} +array(0) { +} +array(3) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + bool(true) +} +array(0) { +} +array(3) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + resource(%d) of type (stream) +} +Done |