Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Fill an array with values
<?php array_fill(int $start_index, int $count, mixed $value): array
<?php }
if (is_numeric($records)) {
$records = array_fill(0, $records, []);
}
return new EloquentCollection(
<?php return array_map(
[$this, 'prepareRule'],
$rule,
array_fill((int) array_key_first($rule), count($rule), $attribute)
);
}
<?php $builder->shouldReceive('take')->andReturnSelf();
$builder->shouldReceive('get')->andReturn(
collect(array_fill(0, 3, 'data'))
);
$this->assertDatabaseHas($this->table, $this->data);
<?php $this->boundValues = array_fill(0, count($this->columnNames), null);
$refs = [];
foreach ($this->boundValues as &$value) {
<?php }
$this->types = str_repeat('s', $paramCount);
$this->_bindedValues = array_fill(1, $paramCount, null);
}
<?php private function appendTypedParameter(array $values, $type): void
{
$this->convertedSQL[] = implode(', ', array_fill(0, count($values), '?'));
$index = count($this->convertedParameteres);
<?php {
Fork::new()
->run(
...array_fill(
start_index: 0,
count: 20,
value: fn () => usleep(100_000),
) // 1/10th of a second each
);
$this->assertTookLessThanSeconds(1);
<?php $expectations = array_merge($expectations, array_combine(array_map(function ($extension) {
return 'ext-'.$extension;
}, $extensions), array_fill(0, count($extensions), array($extensionVersion, array(), array()))));
foreach ($expectations as $packageName => $expectation) {
list($expectedVersion, $expectedReplaces, $expectedProvides) = $expectation;
<?php $this->mockConfig($protocol);
$expectedCalls = array_fill(0, $expectedFailuresBeforeSuccess, array('cmd' => 'git command failing', 'return' => 1));
$expectedCalls[] = array('cmd' => 'git command ok', 'return' => 0);
$this->process->expects($expectedCalls, true);