min
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find lowest value
min
(
mixed $value
,
mixed
...
$values
):
mixed
$collectionCount
=
$this
->
count
();
foreach (
range
(
1
,
min
(
$count
,
$collectionCount
)) as
$item
) {
array_push
(
$results
,
array_pop
(
$this
->
items
));
}
src/Illuminate/Collections/Collection.php
$collectionCount
=
$this
->
count
();
foreach (
range
(
1
,
min
(
$count
,
$collectionCount
)) as
$item
) {
array_push
(
$results
,
array_shift
(
$this
->
items
));
}
src/Illuminate/Collections/Collection.php
:
''
;
$runTimeWidth
=
mb_strlen
(
$runTime
);
$width
=
min
(
terminal
()->
width
(),
150
);
$dots
=
max
(
$width
-
$descriptionWidth
-
$runTimeWidth
-
10
,
0
);
$this
->
output
->
write
(
str_repeat
(
'<fg=gray>.</>'
,
$dots
),
false
,
$verbosity
);
src/Illuminate/Console/View/Components/Task.php
for (
$i
=
0
;
$i
<
100
;
$i
++) {
$lengths
[] =
strlen
(
$e
->
encrypt
(
'foo'
));
}
$this
->
assertSame
(
min
(
$lengths
),
max
(
$lengths
));
}
public function
testWithCustomCipher
()
tests/Encryption/EncrypterTest.php
$this
->
assertInstanceOf
(
$collection
,
$random
);
$this
->
assertCount
(
2
,
$random
);
$random
=
$data
->
random
(fn (
$items
) =>
min
(
10
,
count
(
$items
)));
$this
->
assertInstanceOf
(
$collection
,
$random
);
$this
->
assertCount
(
6
,
$random
);
}
tests/Support/SupportCollectionTest.php
[
$sum
,
$max
,
$min
] =
$data
->
reduceSpread
(function (
$sum
,
$max
,
$min
,
$value
) {
$sum
+=
$value
;
$max
=
max
(
$max
,
$value
);
$min
=
min
(
$min
,
$value
);
return [
$sum
,
$max
,
$min
];
},
0
,
PHP_INT_MIN
,
PHP_INT_MAX
);
tests/Support/SupportCollectionTest.php