zend-form
zend-form copied to clipboard
Form annotations don't work on PHP 7
I've narrowed the problem down the the Zend-code dependency. I don't know if there is any way we can fix this for PHP 7; perhaps a documentation update warning of this fact. ~~The fix I assume is going to be to upgrade to Zend-code 3 which has PHP 7 support.~~ Turns out even Zend code 3.0.0 isn't sufficient
Related:
- https://github.com/zendframework/zend-code/issues/49
- https://bugs.php.net/bug.php?id=71914
What's your opinion on switching to use doctrines annotation parser anyway as it's better than the Zend one? Plus it would remove the dependency on Zend code from the form module.
@carnage We already delegate to Doctrine's annotation parser; all our code does is get the raw annotations and pass them to that. (zend-code provides the reflection functionality for retrieving the annotations, which is not something we want to duplicate here.)
Doctrine's annotation parser is already capable of getting the raw annotations and does it correctly in PHP 7. We are only using Zend code here to parse the file which isn't required for our use case here as we only need the doc blocks.
any news on this?
Seems the problem only exists on PHP 7.0.5 a newer version should work otherwise there is a WIP pull request which fixes the issue: you could use my fork/patch or finish off the fix and make a proper PR with it.
Ideally, a refactor which removes the Zend code dependency would be the best option.
Thanks for Your quick reply! Using exactly PHP 7.0.5 on my shared host :-( Will be using Your fork. Thanks, LT.
Might I suggest, for stability purposes, you make your own fork of my patch and use that.
Yes, thanks for the suggestion
This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at https://github.com/laminas/laminas-form/issues/48.