If you need a higher-dimensional diagonal length (norm), you can exploit the fact that sqrt(x*x+y*y+z*z) == sqrt(x*x+sqrt(y*y+z*z)). In other words hypot(x, y, z)==hypot(x, hypot(y, z)).
To be generic about it....
<?php
function norm(...$args)
{
return array_reduce($args, 'hypot', 0);
}
?>