在PHP5.4上使用Google翻译的API报错

2023-06-09,,

/**********************************************************************
* 在PHP5.4上使用Google翻译的API报错
* 说明:
* 本来是想使用百度的翻译API,结果百度翻译:红色 --> gules。都不知道
* 还能说什么好了。
*
* 2018-3-16 深圳 宝安西乡 曾剑锋
*********************************************************************/ 一、参考文档:
. Php 5.4 Version Not Working
https://github.com/Stichoza/google-translate-php/issues/38 二、错误现象:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in xxx/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php on line 三、解决办法:
选择大于等于5.5版本的PHP。

在PHP5.4上使用Google翻译的API报错的相关教程结束。

《在PHP5.4上使用Google翻译的API报错.doc》

下载本文的Word格式文档,以方便收藏与打印。