2

I'm attempting to run Craft (2.4.2696) on a server with PHP 7 RC, and I'm seeing the following PHP warning:

Declaration of Craft\DbCommand::addForeignKey($table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL) should be compatible with CDbCommand::addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = NULL, $update = NULL)

It's only a warning, and with devMode off, the site seems to function well. I'm not going to put anything that throws warnings into production, though.

My question(s): What is the cause for this warning, and is it something I can fix myself? Does Craft officially support PHP 7?

4
  • 1
    Looks like PHP 7 reclassified some error messages from E_STRICT to E_WARNING (including this one): wiki.php.net/rfc/… Will update with an answer if I can think of a clean solution. – Brad Bell Oct 12 '15 at 17:54
  • Sweet, thanks @BradBell. I can revert to 5.6 but it would be fun to play around with 7. Also interested in knowing whether Craft 2.x officially supports 7 or if its too early yet. The docs doesn't mention it at all. – Mats Mikkel Rummelhoff Oct 12 '15 at 17:55
  • 1
    FWIW Craft 3 doesn't have this issue, too. – Brad Bell Oct 12 '15 at 18:02
  • Good to know ;) – Mats Mikkel Rummelhoff Oct 12 '15 at 18:03
4

As @mmikkel pointed out, as of Craft 2.4.2697, Craft is PHP 7 compatible.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.