Answers.Body: <p>As @mmikkel pointed out, as of <a href="http://buildwithcraft.com/updates#build2697" rel="nofollow">Craft 2.4.2697</a>, Craft is PHP 7 compatible.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-15T19:55:27.183Z
Answers.Text: [Craft 2.4.2697 is out, adding PHP 7 compatibility](http://buildwithcraft.com/updates#build2697).
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T19:55:15.183Z
Answers.Text: [Craft 2.7](https://craftcms.com/news/craft-2-7) also has PHP 7.2 support.
Answers.UserDisplayName: Frank Lämmer
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-12T19:54:57.163Z
Answers.LastActivityDate: 2015-10-15T21:06:22.373Z
Answers.LastEditDate: 2015-10-15T21:06:22.373Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm attempting to run Craft (2.4.2696) on a server with PHP 7 RC, and I'm seeing <a href="http://cly.mmikkel.no/image/310E1X203U0Y" rel="nofollow">the following PHP warning</a>:</p>
  
  <p><code>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)
  </code></p>
  
  <p>It's only a warning, and with <code>devMode</code> off, the site seems to function well. I'm not going to put anything that throws warnings into production, though.</p>
  
  <p>My question(s): What is the cause for this warning, and is it something I can fix myself? Does Craft officially support PHP 7?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-12T17:54:29.537Z
Comments.Text: Looks like PHP 7 reclassified some error messages from E_STRICT to E_WARNING (including this one): https://wiki.php.net/rfc/reclassify_e_strict#signature_mismatch_during_inheritance Will update with an answer if I can think of a clean solution.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-12T17:55:56.770Z
Comments.Text: 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.
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-12T18:02:21.973Z
Comments.Text: FWIW Craft 3 doesn't have this issue, too.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-12T18:03:14.937Z
Comments.Text: Good to know ;)
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Tags: <php><server>
Title: Does Craft work with PHP 7?
ThreadText: # Does Craft work with PHP 7?
  
  (Asked by: username_0 on 2015-10-12)
  
  I'm attempting to run Craft (2.4.2696) on a server with PHP 7 RC, and I'm seeing [the following PHP warning](http://cly.mmikkel.no/image/310E1X203U0Y):
  
  `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?
  
  **Tags:** php, server
  
  > **Comments:**
  > **username_1**: Looks like PHP 7 reclassified some error messages from E_STRICT to E_WARNING (including this one): https://wiki.php.net/rfc/reclassify_e_strict#signature_mismatch_during_inheritance Will update with an answer if I can think of a clean solution.  
  > **username_0**: Sweet, thanks @username_1. 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.  
  > **username_1**: FWIW Craft 3 doesn't have this issue, too.  
  > **username_0**: Good to know ;)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-12. Score: 4 | Accepted answer
  
  As @mmikkel pointed out, as of [Craft 2.4.2697](http://buildwithcraft.com/updates#build2697), Craft is PHP 7 compatible.
  
  > **Comments:**
  > **username_0**: [Craft 2.4.2697 is out, adding PHP 7 compatibility](http://buildwithcraft.com/updates#build2697).  
  > **username_2**: [Craft 2.7](https://craftcms.com/news/craft-2-7) also has PHP 7.2 support.  
  
  ---
  
  