Everyone agrees that we hate the #php Enum syntax
-
-
Michaelreplied to CodeByJeff - Now with AI! last edited by
@codebyjeff yeah, but why would you ever use ->value? (unless you are building a framework or something)
And why would you make it all upper case?
Language::Korean
looks neat to me -
CodeByJeff - Now with AI!replied to Michael last edited by
@michael to get the value
-
vansari ✅replied to CodeByJeff - Now with AI! last edited by
@codebyjeff @michael yes, but what is behind the value? Korean?
It’s type safe for function parameters and so. What syntax do you prefer?
-
CodeByJeff - Now with AI!replied to vansari ✅ last edited by
@vansari I liked the old "constant" style
LANGUAGE::KOREAN output "Korean"
it's the "->value" I'm whining about
-
Daniël Klabbersreplied to CodeByJeff - Now with AI! last edited by
@codebyjeff @vansari this only happens with backed enums, like a string enum, see https://www.php.net/manual/en/language.enumerations.backed.php
Copyright © 2024 NodeBB | Contributors