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

Deprecate dynamic properties rfc stdClass use #204

Open
glensc opened this issue May 24, 2022 · 3 comments
Open

Deprecate dynamic properties rfc stdClass use #204

glensc opened this issue May 24, 2022 · 3 comments

Comments

@glensc
Copy link

glensc commented May 24, 2022

In https://stitcher.io/blog/new-in-php-82 you say that you can use #[AllowDynamicProperties] attribute for dynamic attributes.

however, you say:

The same goes for objects of stdClass, they will keep supporting dynamic properties.

will it also work to make your class extend stdClass?

class Post extends \stdClass
{
}
$post->name = 'Name';

perhaps add this bit to the blog as well.

@brendt
Copy link
Owner

brendt commented Jun 1, 2022

That'll work indeed! I'll look at rephrasing it when I've got the time :)

@brendt brendt closed this as completed Jun 1, 2022
@glensc
Copy link
Author

glensc commented Jun 1, 2022

Maybe keep it open until done, so you don't forget! ;)

@glensc
Copy link
Author

glensc commented Jun 1, 2022

Reminds me python2 introducing similar thing for "new" classes:

@brendt brendt reopened this Jun 2, 2022
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

2 participants