Skip to content

Translation collect-phrase command giving Parse error with PHP 7 #3115

Closed
@ashishnai

Description

@ashishnai

Using below mentioned command

bin/magento i18n:collect-phrases -o "translation.csv" MAGENTO_ROOT_PATH

gives

PHP Parse error: syntax error, unexpected 'The' (T_STRING), expecting ';' in /var/www/html/setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php(274) : eval()'d code on line 1

I have tried the command on environment with PHP 5.5 and it works well. Possible reason for this error might be that as of PHP 7, if there is a parse error in the evaluated code, eval() throws a ParseError exception. Before PHP 7, in this case eval() returned FALSE and execution of the following code continued normally.

http://php.net/manual/en/function.eval.php

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions