Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php function test(string $domainCandidate): string { $candidateLabels = explode('.', $domainCandidate); $lastLabel = $candidateLabels[0]; if (strlen($lastLabel) === 2) { return $lastLabel; } /** @psalm-trace $lastLabel */ return ''; }
Snippet created on February 1 2023 at 13:03 UTC
Settings
Get link