Re: Empty subject in match and switch constructions

From: Date: Tue, 04 Feb 2025 21:10:48 +0000
Subject: Re: Empty subject in match and switch constructions
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-126287@lists.php.net to get a copy of this message
It sounds like a nice QOL improvement. I'm ok with preg_match not working and I would even say it would be wrong if it did work like that. It would also prevent people from accidentally forgetting to provide the matching subject in as it would generate UnhandledMatchError with non-bool types. I don't know about switch though. I think switch should always have a subject because it's loose comparison. So if the vote is whether we should allow no subject in both then I would vote no.

« previous php.internals (#126287) next »