PHP Syntax Issue.
I wrote a script while running PHP 8.4. The server this is going to run on is using 8.2. I can't change it, it's not my website.
There is, apparently, a syntax difference between 8.4 and 8.2 when it comes to dynamically filling in both which Enum type and which case of that Enum it is I'm wanting to use, and now chunks of what I wrote no longer work. I didn't realize this would happen at the time.
All of that to say, this works in 8.4:
But it doesn't in 8.2 (or 8.3).
And this:
did not fix it, it just gave me a different fatal error.
The original error:
is not helpful because it's not a static property in the first place, it's an Enum case. The interpreter is misinterpreting.
Anybody know what I'm meant to do here? Or am I just SOL? I do have an alternative in mind that'll probably work, but I'd prefer doing this to that if I can.
Thanks.
There is, apparently, a syntax difference between 8.4 and 8.2 when it comes to dynamically filling in both which Enum type and which case of that Enum it is I'm wanting to use, and now chunks of what I wrote no longer work. I didn't realize this would happen at the time.
All of that to say, this works in 8.4:
But it doesn't in 8.2 (or 8.3).
And this:
did not fix it, it just gave me a different fatal error.
The original error:
Fatal error: Uncaught Error: Access to undeclared static property Items\Enums\Tier0::$itemnameis not helpful because it's not a static property in the first place, it's an Enum case. The interpreter is misinterpreting.
Anybody know what I'm meant to do here? Or am I just SOL? I do have an alternative in mind that'll probably work, but I'd prefer doing this to that if I can.
Thanks.
