Question from the PHP7 test

Write a PHP function that takes an arbitrary number of integers as arguments and returns their sum.

Hard

What will this code display?

<?php

function sumOfInts(int... $ints)
{
    return array_sum($ints);
}

var_dump(sumOfInts(2, '3', 4.1));

Author: Julien BreuxStatus: PublishedQuestion passed 1053 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!