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

self, parent and static in callable are deprecated since PHP 8.2 and throw a notice #10837

Closed
kkmuffme opened this issue Mar 16, 2024 · 1 comment · Fixed by #10839
Closed

Comments

@kkmuffme
Copy link
Contributor

https://psalm.dev/r/24b9ea4a40

Copy link

I found these snippets:

https://psalm.dev/r/24b9ea4a40
<?php
class Z {
    public static function hello() : void {
 		echo "hello";       
    }
}

class A extends Z {
 	public function __construct() {
     	$this->run( 'parent::hello' ); // should be an error
        $this->run( ['self', 'hello'] ); // should be an error
    }
    
    /**
     * @param callable $callable
     * @return void
     */
    public function run($callable) {
        call_user_func($callable);
    }
}

new A();
Psalm output (using commit ef3b018):

No issues!

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

Successfully merging a pull request may close this issue.

2 participants