mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-10 03:01:01 +00:00
15 lines
268 B
PHP
15 lines
268 B
PHP
<?php
|
|
require_once('distance.php');
|
|
|
|
function distance(array $point) : float
|
|
{
|
|
return sqrt($point[0] ** 2 + $point[1] ** 2);
|
|
}
|
|
|
|
$points = [[3, 5], [5, 3], [5, 5], [5, 0]];
|
|
$objects = array_map('distance', $points);
|
|
|
|
echo '<pre>';
|
|
print_r($objects);
|
|
echo '</pre>';
|