PHP 8.5.0 Alpha 2 available for testing

Voting

: min(one, one)?
(Example: nine)

The Note You're Voting On

gergely dot lukacsy at streamnet dot hu
2 years ago
Just a little correction for Andre D's answer: "(bool) array_product($array);" is equivalent with the conjunction of each array elements of $array, UNLESS the provided array is empty in which case array_product() will return 1, which will translate to boolean TRUE.

To mitigate this, you should expand the function with an additional check:

<?php

$result
= !empty($check) && !!array_product($check);

?>

<< Back to user notes page

To Top