- Issue created by @dharmendart
- First commit to issue fork.
- @jeroent opened merge request.
- Status changed to Needs review
almost 2 years ago 7:29am 16 October 2023 - 🇮🇳India sarwan_verma
Hi @dharmendart,
I have fixed this issue "PHP 8.2 Deprecated function: Creation of dynamic property" and also attached patch,
please review and verify, - 🇫🇷France ckhalilo France
You have to add AllowedDynamicProperties to final class to skip this error.
I have added this patch - 🇨🇦Canada geoanders Nova Scotia 🍁
#6 seems like the correct fix here.
More information on the matter: https://www.php.net/manual/en/class.allowdynamicproperties.php
- 🇦🇺Australia pasan.gamage
Tested on D 10.1.8 PHP8.2 and the error no longer appears.
- Status changed to RTBC
over 1 year ago 2:17am 17 April 2024 - Status changed to Needs work
5 months ago 7:36pm 7 April 2025 - 🇨🇦Canada colan Toronto 🇨🇦
Why are we muting a deprecation notice instead of using the newer API? Seems like we're treating a symptom here instead of the root cause. Or am I missing something?
- 🇫🇷France ckhalilo France
ckhalilo → changed the visibility of the branch 3360409-16 to hidden.
- 🇫🇷France ckhalilo France
ckhalilo → changed the visibility of the branch 3360409-16 to active.
- 🇫🇷France ckhalilo France
ckhalilo → changed the visibility of the branch 8.x-2.x to hidden.
- Assigned to ckhalilo
- Status changed to Needs review
about 2 months ago 6:49am 14 July 2025 - 🇬🇧United Kingdom siliconmeadow
I looked into the deprecated function and found the solution that @ckhalio has in https://git.drupalcode.org/project/az_blob_fs/-/merge_requests/19 is sooo close. The simplest and most elegant solution is, in fact, to add
$context
as a property to the class. TheAzBlobFsStream
's is a version of the PHP streamWrapper, and it would appear that the `$context` property has been around since at least PHP 5 or so. Therefore, adding it would be backwardly compatible as well.This would be a quick win and be one less thing in the issue queue, were it to be fixed.
In that merge request, all that is required is to convert the property from private to public, as documented in the PHP docs. If you look at core, there are a couple of classes in core that demonstrate using
public $context
:- core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php
- core/lib/Drupal/Core/StreamWrapper/LocalStream.php