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

[5.7] Replace get_called_class() with static::class #27146

Merged
merged 1 commit into from
Jan 12, 2019
Merged

[5.7] Replace get_called_class() with static::class #27146

merged 1 commit into from
Jan 12, 2019

Conversation

KennedyTedesco
Copy link
Contributor

get_called_class() can be securely replaced with static::class.

Also, this function will be marked as deprecated in PHP 7.4: https://wiki.php.net/rfc/deprecations_php_7_4#get_called_class_function

`get_called_class()` can be securely replaced with `static::class`. Also, this function will be marked as deprecated in PHP 7.4:  https://wiki.php.net/rfc/deprecations_php_7_4#get_called_class_function
@taylorotwell taylorotwell merged commit a24a3db into laravel:5.7 Jan 12, 2019
@KennedyTedesco KennedyTedesco deleted the 5.7-minor branch January 12, 2019 21:25
@carusogabriel
Copy link
Contributor

Note that the 7.4 Deprecations RFC haven't been voted yet, so

this function will be marked as deprecated in PHP 7.4

isn't true 😅

@KennedyTedesco
Copy link
Contributor Author

KennedyTedesco commented Jan 14, 2019

Sometimes we need to go further. hahaha Yeah, but it's an RFC from Nikita Popov, do you really believe that will not pass? Well, all open, but let's see.

Anyways, static::class is a way better in my opinion. :D

@javiercno
Copy link

Sometimes we need to go further. hahaha Yeah, but it's an RFC from Nikita Popov, do you really believe that will not pass? Well, all open, but let's see.

Anyways, self::class is a way better in my opinion. :D

self::class returns the parent class, the correct is static.

@KennedyTedesco
Copy link
Contributor Author

@javiercno I wrote it wrong. Just edited my previous comment. Thanks.

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

Successfully merging this pull request may close these issues.

4 participants