zf1s / zf1

Monorepo of a fork of Zend Framework 1, with all components split into individual composer packages. PHP 5.3-8.3 compatible.
BSD 3-Clause "New" or "Revised" License
57 stars 22 forks source link

php8.2 compat: allow dynamic props in Zend_Form, Zend_Form_Element and Zend_View_Abstract #180

Closed falkenhawk closed 6 months ago

falkenhawk commented 6 months ago

followup to #170

It looks like it's safe to use the #[AllowDynamicProperties] attribute, and it should still be valid for php 9.0 and not throw an error, contrary to what I understood at first.

As per RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties#proposal "The creation of dynamic properties on classes that aren't marked with the #[AllowDynamicProperties] attribute is deprecated in PHP 8.2 and becomes an Error exception in PHP 9.0."

Related issues from zf1-future where they went with refactoring those classes to use a defined property to store all previously dynamic props in an array, which introduced breaking changes: https://github.com/Shardj/zf1-future/issues/307#issuecomment-1430108870 https://github.com/Shardj/zf1-future/pull/261 https://github.com/Shardj/zf1-future/pull/268 https://github.com/Shardj/zf1-future/issues/328 https://github.com/Shardj/zf1-future/pull/329