We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In https://stitcher.io/blog/new-in-php-82 you say that you can use #[AllowDynamicProperties] attribute for dynamic attributes.
#[AllowDynamicProperties]
however, you say:
The same goes for objects of stdClass, they will keep supporting dynamic properties.
stdClass
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.
The text was updated successfully, but these errors were encountered:
That'll work indeed! I'll look at rephrasing it when I've got the time :)
Sorry, something went wrong.
Maybe keep it open until done, so you don't forget! ;)
Reminds me python2 introducing similar thing for "new" classes:
No branches or pull requests
In https://stitcher.io/blog/new-in-php-82 you say that you can use
#[AllowDynamicProperties]
attribute for dynamic attributes.however, you say:
will it also work to make your class extend
stdClass
?perhaps add this bit to the blog as well.
The text was updated successfully, but these errors were encountered: