Skip to content

Instantly share code, notes, and snippets.

@aleduca
Created November 9, 2022 21:32
Show Gist options
  • Save aleduca/625c5c41c16b380cc1123acb98d4774a to your computer and use it in GitHub Desktop.
Save aleduca/625c5c41c16b380cc1123acb98d4774a to your computer and use it in GitHub Desktop.
<?php
// errado
namespace app\helpers;
class Uri
{
public static function get($type): string
{
return parse_url($_SERVER['REQUEST_URI'][$type]);
}
}
// correto
namespace app\helpers;
class Uri
{
public static function get($type): string
{
return parse_url($_SERVER['REQUEST_URI'])[$type];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment