aboutsummaryrefslogtreecommitdiff
path: root/challenge-267/2colours/php/ch-1.php
blob: 8b6b877a8aed37878ac27d2b8f9056deef4c5254 (plain)
1
2
3
4
5
6
7
8
<?php

function sign_of_product(array $ints)
{
    return array_reduce($ints, fn($acc, $current) => $acc * gmp_sign($current), 1);
}

echo 'The sign of the product is ' . sign_of_product(array_slice($argv, 1));