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

I't impossible to deprecate a named constant via define #11161

Open
yevgen-2m opened this issue Nov 20, 2024 · 3 comments
Open

I't impossible to deprecate a named constant via define #11161

yevgen-2m opened this issue Nov 20, 2024 · 3 comments

Comments

@yevgen-2m
Copy link

This is exaple of code:

<?php

$someValue = 'abc';

/**
 * @deprecated
 */
define('SOME_VALUE', $someValue);

echo SOME_VALUE;

Expected behaviour: Should be warning: defined constant SOME_VALUE is deprecated
Actual behaviour: No issues

Copy link

Hey @yevgen-2m, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.

@yevgen-2m
Copy link
Author

Copy link

I found these snippets:

https://psalm.dev/r/65428f72ca
<?php

$instPath = 'abc';

/**
 * @deprecated
 */
define('INST_PATH', $instPath);

echo INST_PATH;
Psalm output (using commit 03ee02c):

No issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant