New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.7] PHP7 Error : 'String' class name is reserved #7573
Comments
|
2.x is not compatible is PHP 7. We cannot change the class name The class has already been renamed in CakePHP 3.x which is compatible with PHP 7. |
|
You should be using the |
|
Ah I forgot we did rename the class in 2.x too. But we don't run the testsuite for 2.x on PHP 7 (probably due to phpunit issues) so can't claim compatibility with PHP 7 even though it will probably run. |
|
@ADmad it is also unlikely that all the community plugins have or will switch to CakeText. |
|
Thank you @ADmad & @josegonzalez. I didn't notice it was changed, it worked fine with CakeText now. @markstory I totally agree with you, but changing it in the Migrations plugin wasn't a bit deal, it's only there in the Console/Command/MigrationShell.php I know maintaining the compatibility won't always be that easy, but it's worth it, looking into the number of Cake2.x apps and the expected performance enhancements of PHP7. Thank you all for the efforts |
|
I was getting same issue. and Problem Solved |
|
@abhilashlohar I have the same problem and apply your solution, but for static text (i18n) only the first character is displayed. An idea ? Works with 2.3.5 |
|
@diyfr have your problem resolved ? |
|
Guys this is not a help forum and your issue is unrelated to this ticket. Please take your discussion to the official forum or stackoverflow. |
|
@abhilashlohar Yes. |
|
@josegonzalez thank you for your comment. I have used CakeText insted of String. Now this is working fine. But I am not sure that is right way or not. |
|
CakeText is the right way for Cake 2.x. |
|
@dereuromark thanks |
|
@dereuromark I am getting same error. Can you please hlep me. I am getting this error in my controller. |
|
It must be a dev error on your side. Make sure you only have a single CakeText class (the one CakePHP offers). |
|
@derekperkins |
thanks bro you don't know how much time you saved |
thanks you saved my time |

Today I was testing my CakePHP v2.7.5 application against PHP7 to check on its compatibility and get it ready with the final stable release of php when it arrives.
I got this error when I tried to run some migration files:
Didn't test it over with CakePHP v3 but I guess the utility class name "String" should be changed in older versions.
The text was updated successfully, but these errors were encountered: