You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
--TEST--basic array_fill test--FILE--<?php$array1 = array(0.0, 1, 2.5);$array2 = array(TRUE, FALSE, NULL, "d", "e", "f");foreach($array1 as $start){ foreach($array1 as $num) { foreach($array2 as $value) { echo '==========================='."\n"; echo 'start: '.$start.' num: '.$num.' value: '.$value."\n"; $output = array_fill($start, $num, $value); var_dump($output); } }}echo '== Done ==';?>===============Done====================--EXPECTF--===========================start: 0 num: 0 value: 1
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 0 value: d
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 0 value: e
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 0 value: f
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 0 num: 1 value: 1array(1) { [0]=> bool(true)}===========================start: 0 num: 1 value: array(1) { [0]=> bool(false)}===========================start: 0 num: 1 value: array(1) { [0]=> NULL}===========================start: 0 num: 1 value: darray(1) { [0]=> string(1) "d"}===========================start: 0 num: 1 value: earray(1) { [0]=> string(1) "e"}===========================start: 0 num: 1 value: farray(1) { [0]=> string(1) "f"}===========================start: 0 num: 2.5 value: 1array(2) { [0]=> bool(true) [1]=> bool(true)}===========================start: 0 num: 2.5 value: array(2) { [0]=> bool(false) [1]=> bool(false)}===========================start: 0 num: 2.5 value: array(2) { [0]=> NULL [1]=> NULL}===========================start: 0 num: 2.5 value: darray(2) { [0]=> string(1) "d" [1]=> string(1) "d"}===========================start: 0 num: 2.5 value: earray(2) { [0]=> string(1) "e" [1]=> string(1) "e"}===========================start: 0 num: 2.5 value: farray(2) { [0]=> string(1) "f" [1]=> string(1) "f"}===========================start: 1 num: 0 value: 1
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 0 value: d
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 0 value: e
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 0 value: f
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 1 num: 1 value: 1array(1) { [1]=> bool(true)}===========================start: 1 num: 1 value: array(1) { [1]=> bool(false)}===========================start: 1 num: 1 value: array(1) { [1]=> NULL}===========================start: 1 num: 1 value: darray(1) { [1]=> string(1) "d"}===========================start: 1 num: 1 value: earray(1) { [1]=> string(1) "e"}===========================start: 1 num: 1 value: farray(1) { [1]=> string(1) "f"}===========================start: 1 num: 2.5 value: 1array(2) { [1]=> bool(true) [2]=> bool(true)}===========================start: 1 num: 2.5 value: array(2) { [1]=> bool(false) [2]=> bool(false)}===========================start: 1 num: 2.5 value: array(2) { [1]=> NULL [2]=> NULL}===========================start: 1 num: 2.5 value: darray(2) { [1]=> string(1) "d" [2]=> string(1) "d"}===========================start: 1 num: 2.5 value: earray(2) { [1]=> string(1) "e" [2]=> string(1) "e"}===========================start: 1 num: 2.5 value: farray(2) { [1]=> string(1) "f" [2]=> string(1) "f"}===========================start: 2.5 num: 0 value: 1
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 0 value:
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 0 value: d
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 0 value: e
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 0 value: f
Warning: array_fill(): Number of elements must be positive in %s on line %dbool(false)===========================start: 2.5 num: 1 value: 1array(1) { [2]=> bool(true)}===========================start: 2.5 num: 1 value: array(1) { [2]=> bool(false)}===========================start: 2.5 num: 1 value: array(1) { [2]=> NULL}===========================start: 2.5 num: 1 value: darray(1) { [2]=> string(1) "d"}===========================start: 2.5 num: 1 value: earray(1) { [2]=> string(1) "e"}===========================start: 2.5 num: 1 value: farray(1) { [2]=> string(1) "f"}===========================start: 2.5 num: 2.5 value: 1array(2) { [2]=> bool(true) [3]=> bool(true)}===========================start: 2.5 num: 2.5 value: array(2) { [2]=> bool(false) [3]=> bool(false)}===========================start: 2.5 num: 2.5 value: array(2) { [2]=> NULL [3]=> NULL}===========================start: 2.5 num: 2.5 value: darray(2) { [2]=> string(1) "d" [3]=> string(1) "d"}===========================start: 2.5 num: 2.5 value: earray(2) { [2]=> string(1) "e" [3]=> string(1) "e"}===========================start: 2.5 num: 2.5 value: farray(2) { [2]=> string(1) "f" [3]=> string(1) "f"}== Done =================Done====================
|