Typescript Type Last Element Of Array Php Functions String