Answers.Body: <p>Yes it's just a large task and they're getting fixed but slowly. Unlike every other language on the planet php itself has greatly changed, and keeps changing every couple months. As a comparison, imagine if javascript now decided to output warnings when doing something like <code>a + b</code> and a=2 and b=null. So much javascript on the internet would be throwing warnings and need changing.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-30T20:01:45.183Z
Answers.LastActivityDate: 2022-11-30T20:01:45.183Z
Answers.UserDisplayName: Demerit
Body: <p>Drupal 9 has now deprecated PHP 7.4. CiviCRM gives lots of deprecated and warning messages under PHP 8.1. It is possible to suppress them by adding</p>
  <pre><code>// PHP 8.1 generates lots of warnings that 7.4 does not.
  error_reporting(E_ALL &amp; ~E_DEPRECATED &amp; ~E_WARNING);
  </code></pre>
  <p>immediately before</p>
  <pre><code>require_once 'CRM/Core/ClassLoader.php';
  CRM_Core_ClassLoader::singleton()-&gt;register();
  </code></pre>
  <p>at the bottom of civicrm.settings.php. However, are there plans to change the code so those warnings are no longer given? It is surely better to make sure the code doesn't give deprecated and warning messages?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-02T11:02:27.753Z
Comments.Text: after updating to PHP 8.1, I have a punch of warning, like: ```
  Warning: Undefined array key "pledgeBlock" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 138 Warning: Undefined array key "pcpSupporterText" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 222 Warning: Undefined array key "showMainEmail" in /.../uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 230 Warning: Undefined array key "onBehalfOfFields" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%B0/B02/B02188B6%%
Comments.UserDisplayName: Charly
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-02T18:57:37.333Z
Comments.Text: pls don't ask a question as an Answer, best to start a new Question and reference this one
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-05T11:56:46.020Z
Comments.Text: See the comment above about suppressing warning while PHP 8.1 support gets sorted.
Comments.UserDisplayName: Stephen Palmstrom
Tags: <civicrm.settings.php><core><php8>
Title: CiviCRM support for PHP 8.1?
ThreadText: # CiviCRM support for PHP 8.1?
  
  (Asked by: username_0 on 2022-11-30)
  
  Drupal 9 has now deprecated PHP 7.4. CiviCRM gives lots of deprecated and warning messages under PHP 8.1. It is possible to suppress them by adding
  
  ```
  // PHP 8.1 generates lots of warnings that 7.4 does not.
  error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING);
  
  ```
  
  immediately before
  
  ```
  require_once 'CRM/Core/ClassLoader.php';
  CRM_Core_ClassLoader::singleton()->register();
  
  ```
  
  at the bottom of civicrm.settings.php. However, are there plans to change the code so those warnings are no longer given? It is surely better to make sure the code doesn't give deprecated and warning messages?
  
  **Tags:** civicrm.settings.php, core, php8
  
  > **Comments:**
  > **username_1**: after updating to PHP 8.1, I have a punch of warning, like: ``` Warning: Undefined array key "pledgeBlock" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 138 Warning: Undefined array key "pcpSupporterText" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 222 Warning: Undefined array key "showMainEmail" in /.../uploads/civicrm/templates_c/de_DE/%%3D/3D1/3D13F2BA%%Main.tpl.php on line 230 Warning: Undefined array key "onBehalfOfFields" in /.../wp-content/uploads/civicrm/templates_c/de_DE/%%B0/B02/B02188B6%%  
  > **username_2**: pls don't ask a question as an Answer, best to start a new Question and reference this one  
  > **username_0**: See the comment above about suppressing warning while PHP 8.1 support gets sorted.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2022-11-30. Score: 1
  
  Yes it's just a large task and they're getting fixed but slowly. Unlike every other language on the planet php itself has greatly changed, and keeps changing every couple months. As a comparison, imagine if javascript now decided to output warnings when doing something like `a + b` and a=2 and b=null. So much javascript on the internet would be throwing warnings and need changing.
  
  
  ---
  
  