Open michalbundyra opened 4 years ago
Can you avoid the circular dependency?
To be honest I don't think we will implement some kind of circular depedency check because it could affect to the performance.
Originally posted by @Maks3w at https://github.com/zendframework/zend-validator/issues/82#issuecomment-221534430
I've worked around it by handling the array to string conversion manually by overriding setValue. This may cause issues with built in validators provided by Zend but it's only a minor inconvenience for my use case.
Originally posted by @tomp4l at https://github.com/zendframework/zend-validator/issues/82#issuecomment-221535134
As the
\Zend\Validator\AbstractValidator::createMessage
method usesvar_export
to convert arrays to strings this fails if the array contains a circular reference. The problem line is https://github.com/zendframework/zend-validator/blob/master/src/AbstractValidator.php#L294.I've provided a quick example of this below which outputs "PHP Warning: var_export does not handle circular references":
Originally posted by @tomp4l at https://github.com/zendframework/zend-validator/issues/82