Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constants inconsistence #6

Open
jagarsoft opened this issue Oct 27, 2022 · 1 comment
Open

Constants inconsistence #6

jagarsoft opened this issue Oct 27, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jagarsoft
Copy link
Owner

In v1.x it had no $:

public const NEXT_STATE = 0;

In v2.x was wrongly renamed to string:

static int $NEXT_STATE = 0;

Moreover, it does not use Enum like in Stubs examples.

@jagarsoft jagarsoft added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Oct 27, 2022
@jagarsoft
Copy link
Owner Author

Fortunately, change can be done without breaking backward compatibility

<?php
// Your code here!
class Ex {
    public const NEXT_STATE = 0;
    static int $NEXT_STATE = 1;
}

$a = new Ex();
echo $a::NEXT_STATE;
echo $a::$NEXT_STATE;
?>

but change must deprecate variables (with $)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant