zend-form icon indicating copy to clipboard operation
zend-form copied to clipboard

Form annotations don't work on PHP 7

Open carnage opened this issue 8 years ago • 10 comments

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

carnage avatar Apr 07 '16 15:04 carnage

Related:

  • https://github.com/zendframework/zend-code/issues/49
  • https://bugs.php.net/bug.php?id=71914

Ocramius avatar Apr 07 '16 20:04 Ocramius

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 avatar Apr 07 '16 20:04 carnage

@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.)

weierophinney avatar Apr 28 '16 19:04 weierophinney

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.

carnage avatar Apr 29 '16 08:04 carnage

any news on this?

lowtower avatar Sep 19 '16 08:09 lowtower

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.

carnage avatar Sep 19 '16 09:09 carnage

Thanks for Your quick reply! Using exactly PHP 7.0.5 on my shared host :-( Will be using Your fork. Thanks, LT.

lowtower avatar Sep 19 '16 09:09 lowtower

Might I suggest, for stability purposes, you make your own fork of my patch and use that.

carnage avatar Sep 19 '16 09:09 carnage

Yes, thanks for the suggestion

lowtower avatar Sep 19 '16 09:09 lowtower

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.

michalbundyra avatar Jan 15 '20 19:01 michalbundyra