Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() #5354

Closed
ppeiris opened this Issue Oct 26, 2013 · 5 comments

Comments

Projects
None yet
6 participants

ppeiris commented Oct 26, 2013

I get this error

Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() (previously declared abstract in Zend\I18n\Translator\TranslatorInterface) in vendor/zendframework/zendframework/library/Zend/Mvc/I18n/Translator.php on line 16

I get the error when I run the code on mac using MAMP (php -v 5.4.17); however running the same code base on ubuntu with php -v 5.4.9 wont give any issues.

I fix the issue by commenting translate() in the Zend\I18n\Translator\TranslatorInterface.php. I assume, since its in the interface class and all the translator methods are already implemented, this (may) not effect the code.

DASPRiD was assigned Oct 26, 2013

Member

Maks3w commented Oct 26, 2013

@ppeiris May you're running the code from the CLI (Mac defaults is 5.3.x)

@DASPRiD May you should attend this.

Owner

weierophinney commented Oct 28, 2013

This is a known issue on the develop branch for pre-5.3 versions of PHP; @DASPRiD has indicated he'll have something this week to correct the situation.

Basically: we have two TranslatorInterface definitions, one in Zend\I18n and one in Zend\Validator. Zend\Mvc\I18n\Translator is implementing both -- something that works fine starting in 5.4, but which causes issues in 5.3. The solution will most likely be to do a proxy or decorator.

Owner

weierophinney commented Mar 4, 2014

"Fixed" in the develop branch by upping the minimum supported PHP version to 5.3.23 for the develop branch (upcoming 2.3.0).

gws referenced this issue in aws/aws-sdk-php-zf2 Apr 19, 2014

Closed

Compatibility with ZF2 2.3 #18

Is this still an issue or resolved?

I found this issue when I was working on http://zf2.readthedocs.org/en/latest/tutorials/unittesting.html

PHP Fatal error:  Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() (previously declared abstract in Zend\I18n\Translator\TranslatorInterface) in zendframework\library\Zend\Mvc\I18n\Translator.php on line 19

OS: Windows 7
PHP: PHP 5.4.12 (cli) (built: Feb 25 2013 00:29:22)
ZF2 Version: 2.3.1

mungiud commented Jul 2, 2014

so, how i can resolv this error, i have php 5.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment