// Used to create fallbacks/defaults, without the need for isset/array_key_exists
$string = $array['value'] ?? $maybethisworks ?? "in case of emergency, use this";
//old
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session as Something;
//new
use Symfony\Component\HttpFoundation\{Request, Response, Session as Something};
// Only accepts arrays, only returns int.
function getFirstValueAsInteger(array $data): int {
return $data[0];
}
// returns int 24
$this->getFirstValueAsInteger(["24","6"]);