-
Notifications
You must be signed in to change notification settings - Fork 65
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
PHP 7.2 compatibility #360
Comments
|
I ran into this while moving from 5.6 to 7.2 due to the former being deprecated. The seems fix is pretty simple, just rename Object to Base_Object. Effectively, the following script will fix the issue(at least according to the testing I've done.)
|
@tpwalsh Thanks for simplifying the solution. However, it looks like your script has a mistake in it. The two "grep" lines search for "Base_Object", but I assume they should search for "Object", right? And similarly, I think the "xargs" commands should reference "Object" in the first half of the regex. That would make the script look like this. Please correct me if I'm wrong. #!/bin/sh
grep -rl "extends Object" * | xargs sed -i 's/extends Object/extends Base_Object/g'
grep -rl "class Object" * | xargs sed -i 's/class Object/class Base_Object/g'
mv ./auth/admin/classes/common/Object.php ./auth/admin/classes/common/Base_Object.php
mv ./licensing/admin/classes/common/Object.php ./licensing/admin/classes/common/Base_Object.php
mv ./management/admin/classes/common/Object.php ./management/admin/classes/common/Base_Object.php
mv ./organizations/admin/classes/common/Object.php ./organizations/admin/classes/common/Base_Object.php
mv ./usage/admin/classes/common/Object.php ./usage/admin/classes/common/Base_Object.php |
I have no idea why I didn't see the notification of your reply(I'm still new to github I guess). Yes your changes are correct. We've been running this code in production for about a month now with no reported errors. |
any luck with solving this issue without downgrading the PHP version ? |
@zalpany2000 Yes, you can apply the patch from the following pull request, which should fix CORAL for PHP 7.2: You can also consider testing the development branch of CORAL, which has other recent fixes but has not been thoroughly tested or released to the public yet: Please email the CORAL User List (coral-user@lists.coral-erm.org) if you have comments or questions about either of those suggestions. You will probably get more response that way, since not many people look at CORAL's GitHub. |
When using CORAL with PHP 7.2, a user reported the following error:
Fatal error: Cannot use 'Object' as class name as it is reserved in C:\xampp\htdocs\coral\resources\admin\classes\common\Object.php on line 20
This seems to be caused by PHP 7.2 changing the word "object" to a fully reserved classname, as explained here:
https://wiki.php.net/rfc/object-typehint
This issue can be used to track other PHP 7.2 compatibility requirements, if there are any.
The text was updated successfully, but these errors were encountered: