Magento 2: How to override Zend library files function only?

I overwrite Captcha module on my WAMP PHP 5.X & it works fine.

On linux server which has PHP 7 gives below error

Fatal error: Declaration of Custom\Captcha\Model\CustomCaptcha::render(Custom\Captcha\Model\Zend_View_Interface $view = NULL, $element = NULL) must be compatible with Zend_Captcha_Adapter::render(Zend_View_Interface $view = NULL, $element = NULL) in /var/www/html/magento/app/code/Custom/Captcha/Model/CustomCaptcha.php on line 156 Segmentation fault (core dumped)

| improve this question | | | | |

Looks like Zend_View_Interface class does not imported in your scope.

You can use import in top of you file:

use Zend_Captcha_Image; 

Or use full class name

public function render(\Zend_View_Interface $view = NULL, $element = NULL)
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.