Annotation of embedaddon/php/ext/standard/tests/array/array_pad.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: array_pad() tests
! 3: --FILE--
! 4: <?php
! 5:
! 6: var_dump(array_pad());
! 7: var_dump(array_pad(array()));
! 8: var_dump(array_pad(array(), 1));
! 9: var_dump(array_pad(array(), 1, 0));
! 10:
! 11: var_dump(array_pad(array(), 0, 0));
! 12: var_dump(array_pad(array(), -1, 0));
! 13: var_dump(array_pad(array("", -1, 2.0), 5, 0));
! 14: var_dump(array_pad(array("", -1, 2.0), 5, array()));
! 15: var_dump(array_pad(array("", -1, 2.0), 2, array()));
! 16: var_dump(array_pad(array("", -1, 2.0), -3, array()));
! 17: var_dump(array_pad(array("", -1, 2.0), -4, array()));
! 18: var_dump(array_pad(array("", -1, 2.0), 2000000, 0));
! 19: var_dump(array_pad("", 2000000, 0));
! 20:
! 21: echo "Done\n";
! 22: ?>
! 23: --EXPECTF--
! 24: Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
! 25: NULL
! 26:
! 27: Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
! 28: NULL
! 29:
! 30: Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
! 31: NULL
! 32: array(1) {
! 33: [0]=>
! 34: int(0)
! 35: }
! 36: array(0) {
! 37: }
! 38: array(1) {
! 39: [0]=>
! 40: int(0)
! 41: }
! 42: array(5) {
! 43: [0]=>
! 44: string(0) ""
! 45: [1]=>
! 46: int(-1)
! 47: [2]=>
! 48: float(2)
! 49: [3]=>
! 50: int(0)
! 51: [4]=>
! 52: int(0)
! 53: }
! 54: array(5) {
! 55: [0]=>
! 56: string(0) ""
! 57: [1]=>
! 58: int(-1)
! 59: [2]=>
! 60: float(2)
! 61: [3]=>
! 62: array(0) {
! 63: }
! 64: [4]=>
! 65: array(0) {
! 66: }
! 67: }
! 68: array(3) {
! 69: [0]=>
! 70: string(0) ""
! 71: [1]=>
! 72: int(-1)
! 73: [2]=>
! 74: float(2)
! 75: }
! 76: array(3) {
! 77: [0]=>
! 78: string(0) ""
! 79: [1]=>
! 80: int(-1)
! 81: [2]=>
! 82: float(2)
! 83: }
! 84: array(4) {
! 85: [0]=>
! 86: array(0) {
! 87: }
! 88: [1]=>
! 89: string(0) ""
! 90: [2]=>
! 91: int(-1)
! 92: [3]=>
! 93: float(2)
! 94: }
! 95:
! 96: Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d
! 97: bool(false)
! 98:
! 99: Warning: array_pad() expects parameter 1 to be array, string given in %s on line %d
! 100: NULL
! 101: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>