zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

Form annotations don't work on PHP 7 #51

Open carnage opened 8 years ago

carnage commented 8 years ago

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

Ocramius commented 8 years ago

Related:

carnage commented 8 years ago

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.

weierophinney commented 8 years ago

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

carnage commented 8 years ago

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.

lowtower commented 8 years ago

any news on this?

carnage commented 8 years ago

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.

lowtower commented 8 years ago

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

carnage commented 8 years ago

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

lowtower commented 8 years ago

Yes, thanks for the suggestion

michalbundyra commented 4 years ago

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.