Title: Warning with PHP 8.1: missing variable initialisation
Last modified: February 14, 2023

---

# Warning with PHP 8.1: missing variable initialisation

 *  [Ulf Brossmann](https://wordpress.org/support/users/ubrossmann/)
 * (@ubrossmann)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/warning-with-php-8-1-missing-variable-initialisation/)
 * Recently, I updated my WP installation to PHP 8.1. Then I checked my website 
   and found a PHP warning:
 *     ```wp-block-code
       Warning: Undefined variable $page_name in /homepages/24/d13366683/htdocs/e-script/wp-content/plugins/blog-introduction/blog-introduction.php on line 116
       ```
   
 * (Same warning came for line 123, too.)
 * The reason for this is an omission in your code: I suggest that you include `
   $page_name = FALSE;` after code line 97 (`} else {`). Otherwise the variable `
   $page_name` will not be initialised, if the calling page is not a WP archive 
   page.

The topic ‘Warning with PHP 8.1: missing variable initialisation’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/blog-introduction.svg)
 * [Blog Introduction](https://wordpress.org/plugins/blog-introduction/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/blog-introduction/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/blog-introduction/)
 * [Active Topics](https://wordpress.org/support/plugin/blog-introduction/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/blog-introduction/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/blog-introduction/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 0 replies
 * 1 participant
 * Last reply from: [Ulf Brossmann](https://wordpress.org/support/users/ubrossmann/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/warning-with-php-8-1-missing-variable-initialisation/)
 * Status: not resolved