Return to array_splice_variation4.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_splice() function : usage variations - non array replacement values 3: --FILE-- 4: <?php 5: /* 6: * proto array array_splice(array input, int offset [, int length [, array replacement]]) 7: * Function is implemented in ext/standard/array.c 8: */ 9: 10: function test_splice ($replacement) 11: { 12: $input_array=array(0,1); 13: var_dump (array_splice ($input_array,2,0,$replacement)); 14: var_dump ($input_array); 15: } 16: 17: test_splice (2); 18: 19: test_splice (2.1); 20: 21: test_splice (true); 22: //file type resource 23: $file_handle = fopen(__FILE__, "r"); 24: 25: test_splice ($file_handle); 26: echo "Done\n"; 27: ?> 28: --EXPECTF-- 29: array(0) { 30: } 31: array(3) { 32: [0]=> 33: int(0) 34: [1]=> 35: int(1) 36: [2]=> 37: int(2) 38: } 39: array(0) { 40: } 41: array(3) { 42: [0]=> 43: int(0) 44: [1]=> 45: int(1) 46: [2]=> 47: float(2.1) 48: } 49: array(0) { 50: } 51: array(3) { 52: [0]=> 53: int(0) 54: [1]=> 55: int(1) 56: [2]=> 57: bool(true) 58: } 59: array(0) { 60: } 61: array(3) { 62: [0]=> 63: int(0) 64: [1]=> 65: int(1) 66: [2]=> 67: resource(%d) of type (stream) 68: } 69: Done