Question from the PHP - Fundamentals test

Use array_map to get the length of each string in an array in PHP

Medium

What is the value of the $lengths variable after the following code is executed ?

function foobar($item) {
	return strlen($item);
}
$strings = ["javascript", "php", "python", "c++"];
$lengths = array_map("foobar", $strings);
Author: ThéoStatus: PublishedQuestion passed 1933 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!